Question: saving plots to a file (from inside a function)


I am trying to be able to solve my plots into a file programatically (not via right click/export).

when I do this:


plotsetup(default):  #optional - just to be sure start off at default.
plotsetup(ps, plotoutput="test.eps", plotoptions=`portrait,noborder`);

things work ok

BUT.. doint this:


savePlot:=proc(v_p, v_fileName)  # lets define a function to do this
  plotsetup(ps, plotoutput=v_fileName, plotoptions=`portrait,noborder`);
  display(v_p);   # also tried without "display"
end proc;
proc(v_p, v_fileName)  ...  end;

savePlot(p, "test.eps");

is broken - no file test.eps gets written to disk.

is this a bug? does anyone have a workour (other than doing this outside of function)?

thank you.

Please Wait...