You can either put the commands inside Draw2D() and put this in the placeholder of an image region (Insert> image) or you put the commands directly in the placeholder of a Maxima-Draw2D region. You mixed the approaches.
See the introductory text in the Chapter Plotting with Maxima.
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx