Question: Can a procedure return separate plots?

Hi everyone,

Here is a problem that I couldn't solve:

I've written a procedure to perform some tasks, and I want it to plot some results as output, in addition to the equations of those plots (I don't think the details of the procedure are necessary at this stage, but I'll be happy to provide if needed). My problem is: Each procedure can only plot a single picture. I know Maple can plot several graphs in one plot region, but is it possible to do the converse?

For example:

p := proc(x,y)
   plot(x^2, x=0..2);
   plot(y^3, y=-2..2);
end proc():


will only plot y^3 from -2 to 2, since in Maple, "the result a procedure returns is the value of the last executed statement in the body of the procedure". What if I wanted it to plot both x^2 and y^3, but in separate plot regions?

Thank you in advance for your time.

Ozgur Inal

Please Wait...