Question about subplots

Thu, 26 Nov 2009 15:13:57 +0000, chombee wrote:

I'm trying to make a figure with six subplots, here's what I've managed
so far:

http://dl.dropbox.com/u/136038/bar-00-protagonist.png

That's actually done with two subplots (the top row and the bottom row)
and what looks almost like 3 separate pairs of axes in each row is
actually just one pair of axes with three sets of data plotted on it.

Perhaps what I've done is the best way to do it. But I think the code
for this would be much simpler if I used six subplots instead, but
here's my problem: I want each subplot to have its own title (easily
done), and I also want the top row of three subplots to have an
associated title and the bottom row of three subplots to have an
associated title. Can I do this? My first instinct was to create two
subplots (top row and bottom row) then within each subplot create three
subplots (three columns), then I could just place all the titles I want
using title() commands. This recursive subplotting doesn't seem to work
though.

You could perhaps use 6 subplots, and place the titles manually.
Something like

  suptitle(r'Top title', y=0.95)
  suptitle(r'Bottom title', y=0.05)

could work. Also, mpl_toolkits.axesgrid may be useful.

ยทยทยท

--
Pauli Virtanen

You could perhaps use 6 subplots, and place the titles manually.
Something like

  suptitle(r'Top title', y=0.95)
  suptitle(r'Bottom title', y=0.05)

Thanks, that worked very well. I got the plot that I wanted and with
much tidier source code:

http://dl.dropbox.com/u/136038/bar-00-protagonist.png

(It still needs a bit of tweaking but it's more or less what I was going
for.)