Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I hate to say this, but the answer is not what you want.

sage: var('t')
t
sage: A = [plot(sin(t+k*pi/4),(-pi,pi)) for k in range(8)]
sage: G = graphics_array(A,3,3)
sage: G[3]
sage: type(G[3])
<class 'sage.plot.plot.Graphics'>

Which only answers the question in the title, which is not the question you want answered - namely, how to make the whole array a Graphics object.

This can certainly be done in theory - see lots-o-plots on the matplotlib site - but we haven't wrapped it. And we don't (quite) have the backward conversion of a mpl object to a Sage Graphics object done (though see Trac 5128. So what I would say to really answer your question is: Do it in straight matplotlib.

And open a few tickets governing some of the behavior you noticed - and maybe a separate one to just refactor the GraphicsArray code completely and make it a useful object in the sense you want (not that it's not very useful already, of course!). This is clearly because of the fact that this class is only really intended for plotting, not the sort of abstract behavior you are mentioning. As far as I can tell, the tip at this blog doesn't work for your case of the Hello World axes.