Well, one approach is to specify a file name in the arguments of plot2d
. Then the plot is output directly to the file and it doesn't show up in the GUI. E.g.,
plot2d (sin(x), [x, 0, 10], [png_file, "mysinplot.png"]);
plot2d
recognizes png_file
, pdf_file
, ps_file
and svg_file
. In each case, ? png_file
, etc, will show some info about that.
Note that there isn't any file output flag for GIF output. The closest thing is PNG which is similar to GIF.
I think draw
also recognizes different file formats but I don't know about that without searching the documentation.
If you are generating a lot of plots, it might be convenient to automatically generate file names via sconcat
, e.g. sconcat("myplot", i, ".png")
produces "myplot10.png"
when i
is equal to 10.