Question: proc to print with plotoptions and naming question

I recently realized that maple/standard has some plotting capabilities not available in maple/classic. I nevertheless plan to stick with classic except for the occasional printing of graphs. I don't want to write multiple worksheets, so I want my worksheet to know when I'm printing in standard and when I'm printing in classic. I don't want a maple/classic plot to overwrite a maple/standard plot (and vice versa). I want to set some classic-specific and standard-specific options.

I wish to write a procedure (let's call it makeplot) that will work in both standard and classic and allow me to name the plotting output with the appropriate _standard or _classic suffix.

The basic idea is in the following -- succesfully tested on Windows/Maple13:

 
if IsWorksheetInterface('Standard') then
plotsetup(ps,plotoutput=`p_standard.eps`,
plotoptions=`color,portrait,noborder`): 
else
plotsetup(ps,plotoutput=`p_classic.eps`,
plotoptions=`nocolor,portrait,noborder`): 
fi;
p:= plot(cos(x), x=-2*Pi..2*Pi):
plots[display](p);  

I'm even able to use the above in a loop:

for i from 1 to 5 do
if IsWorksheetInterface('Standard') then
plotsetup(ps, plotoutput="p"||i||"_standard.eps", 
plotoptions=`color,portrait,noborder`): 
else
plotsetup(ps, plotoutput="p"||i||"_classic.eps", 
plotoptions=`nocolor,portrait,noborder`): 
fi;
p[i]:= plot(cos(i*x), x=-2*Pi..2*Pi):
plots[display](p[i]):
end do;

What I'm looking for is something like the following (which doesn't work) combined with the if loop above:


makeplot:= proc(p)
plotsetup(ps, plotoutput=`p.eps`, 
plotoptions=`portrait,noborder`):
plots[display](p);
plotsetup(default):
end proc:
p:= plot(cos(x), x=-2*Pi..2*Pi):
makeplot(p);

so that when I call makeplot(p); Maple will 1) check if the interface is standard or classic and append the suffix accordingly, 2) use the name of the plot in the naming, thus if the plot is named "myplot" then a call to makeplot(myplot) will produce a plot named either myplot_classic.eps or myplot_standard.eps.

I'm very new to this proc thing. I think that if I know how to write the makeplot procedure, I should be able to combine it with the if loop. Thanks for your help.

Please Wait...