2011/5/12 David Andrews <irbda...@gmail.com>:
> Hi,
>
> I've come across something I don't entirely understand in the
> behaviour of gridspec.  It's not obvious from the code & docs for this
> module, but is it only supposed to be able to deal with 'square'
> layouts, e.g. 3x3, 4x4 etc?
>
> Taking some code from an example on the gridspec page ...
>
> import matplotlib.pylab as plt
> import matplotlib.gridspec as gridspec
> #gs = gridspec.GridSpec(3, 3) # OK
> gs = gridspec.GridSpec(6, 3) # Will cause an error later on
> ax1 = plt.subplot(gs[0, :])
> ax2 = plt.subplot(gs[1,:-1])
> ax3 = plt.subplot(gs[1:,-1])
> ax4 = plt.subplot(gs[-1,0])
> ax5 = plt.subplot(gs[-1,-2])
> plt.show()
>
> ... will fail if that line is uncommented, giving an index error.

Works for me.
Ubuntu 11.04 Natty, stock python 2.7.1 and matplotlib 1.0.1 from
https://launchpad.net/~valavanisalex/+archive/matplotlib.

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to