Problems to plot more than 9 subplots

Hi,

I want to make a figure with 21 subplots (7 x 3) but I cannot plot more than 9 in the function I am using.

class TaylorDiagram(object):

def init(self, refstd, fig=None, rect=111, label=’_’, srange=(0,1.5)):

from matplotlib.projections import PolarAxes

    import mpl_toolkits.axisartist.floating_axes as FA

    import mpl_toolkits.axisartist.grid_finder as GF

ax = FA.FloatingSubplot(fig, rect, grid_helper=ghelper)

    fig.add_subplot(ax) 
   ...

dia = TaylorDiagram(refstd, fig=fig, rect=111, label=“EM”)

The " subplot(111) " works only until 9 subplots, and this function does not allow me to put rect=(7,3,nrfig). I get the error:

‘Single argument to subplot must be a 3-digit integer’)

ValueError: Single argument to subplot must be a 3-digit integer

Can you please help me?
Thanks,

Patricia

The " subplot(111) " works only until 9 subplots, and this function does
not allow me to put rect=(7,3,nrfig). I get the error:
'Single argument to subplot must be a 3-digit integer')
ValueError: Single argument to subplot must be a 3-digit integer

I always do

   ax = fig.add_subplot(7, 3, nfig)

which works. (in list iterations, make sure nfig starts at 1).

Andreas.

Thanks Andreas,
Yes I usually do the same, but in this case I am not managing to do it due
to the functions being used. It does not allow me to put (7,3, nfig) inside
the "xx = TaylorDiagram(refstd, fig=fig, rect=122, label="xx")".
This is the code that I am using:
http://old.nabble.com/Taylor-diagram-(2nd-take)-p33364690.html
Do you see an easy way of adding more than 9 Taylor diagrams subplots in
test1 for example?
Thanks again,
Patricia

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-to-plot-more-than-9-subplots-tp40440p40442.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

1.1.1rc), you could try

   class TaylorDiagram(object):
      def __init__(self, refstd, fig=None, rect=(1, 1, 1), label='_',
srange=(0,1.5)):
          ...
          from matplotlib.projections import PolarAxes
          import mpl_toolkits.axisartist.floating_axes as FA
          import mpl_toolkits.axisartist.grid_finder as GF
          ...

          ax = FA.FloatingSubplot(fig, rect[0], rect[1], rect[2],
grid_helper=ghelper)
          fig.add_subplot(ax)
         ...

   dia = TaylorDiagram(refstd, fig=fig, rect=(3, 7, nrfig, label="EM")

FA.FloatingSubplot docstring says:

Definition:FA.FloatingSubplot(self, fig, *args, **kwargs)
Docstring:
    *fig* is a :class:`matplotlib.figure.Figure` instance.

    *args* is the tuple (*numRows*, *numCols*, *plotNum*), where
    the array of subplots in the figure has dimensions *numRows*,
    *numCols*, and where *plotNum* is the number of the subplot
    being created. *plotNum* starts at 1 in the upper left
    corner and increases to the right.

    If *numRows* <= *numCols* <= *plotNum* < 10, *args* can be the
    decimal integer *numRows* * 100 + *numCols* * 10 + *plotNum*.

Hope that helps,
A.

···

On 02/19/2013 01:52 PM, patricia wrote:

Thanks Andreas,
Yes I usually do the same, but in this case I am not managing to do it due
to the functions being used. It does not allow me to put (7,3, nfig) inside
the "xx = TaylorDiagram(refstd, fig=fig, rect=122, label="xx")".
This is the code that I am using:
http://old.nabble.com/Taylor-diagram-(2nd-take)-p33364690.html
Do you see an easy way of adding more than 9 Taylor diagrams subplots in
test1 for example?

From how I understand the FA.FloatingSubplot docstring (I'm running

Thanks a lot! Works now!

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-to-plot-more-than-9-subplots-tp40440p40444.html
Sent from the matplotlib - users mailing list archive at Nabble.com.