Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You shouldn't even need the axes=True part, I think. If you look at

sage: plot?

you'll see that + is the standard way to add plots.

It sounds like you might want to plot things in a certain order of objects on top of each other; here, the zorder option should often work (though there might be some graphics primitives where it doesn't). Like so:

sage: P = plot(sin,0,pi,zorder=50)
sage: Q = plot(cos,0,pi,color='red',zorder=51)
sage: P+Q

Here, red is on top (like in a plot with no zorder)

sage: Q = plot(cos,0,pi,color='red',zorder=40) 
sage: P+Q

Here, blue is on top.

Note that the behavior without zorder set is sometimes a little enigmatic - I don't know whether P+Q and Q+P always plot the second one on top if you don't use zorder above, since for certain objects that doesn't seem to happen; for these plot types, apparently that does happen, though.