From: Jason Grout <jasonsage@cr...>  20110331 10:10:13

On 3/31/11 3:32 AM, T J wrote: > Any chance matplotlib can get functionality similar to GraphicsArray > in Mathematica? It'd be nice to make a single method to draw whatever > you want and then do this in a list comprehension. At the end, you > can arrange all those plots however you want. > > It looks like Sage has implemented something like this (built on top > of matplotlib, I presume). Would it be difficult to port this to > "pure" matplotlib? > > http://ask.sagemath.org/question/308/caniconvertagraphicsarrayobjecttoagraphics Sage does indeed have a (somewhat crufty) GraphicsArray object [1], which I've been meaning to convert to use the new GridSpec functionality [2]. It is built on top of matplotlib, but the code is fragile and easy to "break". See http://doxdrum.wordpress.com/2010/08/12/graphicsarrayinsagemath/, for example. One thing that would be really nice in GridSpec is if we could plot things recursively. As I understand it right now, using GridSpec, we can arrange a bunch of axes in a grid. However, what if we wanted to put a grid inside of one of the spots in the grid? (I think the same question is: what if we wanted to embed a figure inside another axes?) Jason [1] http://www.sagemath.org/doc/reference/sage/plot/plot.html#sage.plot.plot.graphics_array [2] http://matplotlib.sourceforge.net/users/gridspec.html; http://matplotlib.sourceforge.net/api/gridspec_api.html 