Search code examples
fileterminalpngdrawwxmaxima

wxmaxima wxdraw , wxdraw2d, wxdraw3d. How to change output to a *.png file instead of terminal computer screen


I have successfully changed the output from default terminal screen to a *.png by for example.

[load(implicit_plot),
 gnuplot_out_file[png,"gnu.png"],   
 implicit_plot(x^2+y^2-1,[x,-1,1],[y,-1,1], [gnuplot_term, png], [gnuplot_term, "png size 334,334"]  )]

But since plot cannot fill a figure i need to do it in wxdraw,wxdraw2d,wxdraw3d but have not had success. I tried

(wxdraw3d (enhanced3d = true,explicit(exp(x^2-y^2), x,-2,2,y,-2,2)),wxdraw_file(terminal="draw.png" ))

But it ignored the terminal request. Also

xdraw_file(terminal="draw.png",dimensions=[5,5]);

Did nothing either and i did not get any error output on either. Also the following got no error but did nothing to change color.

set_draw_defaults(color=grey20);

Why is it not working. What can i do. Note I can't use just plain draw because it fails on everything.


Solution

  • for equiv what can do in wxdraw2d and ...3d just replace wxdraw2d or 3d by gr2d or gr3d and preface it by wxdraw(terminal='png,"file_name=",.. such as in example: wxdraw(terminal='png,file_name="dotted", gr2d(fill_color=gray84,ellipse(0,0,1,1,0,360), fill_color=grey77,color=gray20,line_width=2, ellipse(0,0,1,.23,180,180), line_type=dashes, ellipse(0,0,1,.23,0,180), proportional_axes='xy))

    and found the file dotted.png in my ...\maxima-current directory and which is the same image that also appears on the screen.