2010/10/28 Benjamin Root <ben.r...@ou.edu>:
> On Thu, Oct 28, 2010 at 1:18 PM, Will Grover <wgro...@mit.edu> wrote:
>> Hello matplotlib-users,
>> I'm using subplots to make an array of plots, but because some of the
>> plots have wider y-axis tick labels than others, some of the subplots end up
>> looking too close to each other.  Here's an image that shows what I mean:
>>   http://web.mit.edu/wgrover/www/spacing.png
>> I'm currently using pylab.subplots_adjust(hspace = __, vspace = __) to
>> adjust the subplot spacing, but since that applies to all subplots, no one
>> setting looks right for the entire array of plots.  Is there any way to set
>> the spacing so that the subplots *plus tick labels* are evenly distributed?
>>  Or can I manually specify the spacing between each subplot?  Thanks,
>
> It is *possible*, but it is probably would be an incredible amount of work
> (unless someone knows of some nifty trick that I am not aware of).  My
> suggestion to make things appear more "even" is to adjust the position of
> the ylabels in the second column to that it takes up more room between the
> first two columns.

> The hard way would be to manually specify the extents in the "position"
> kwarg [left, bottom, width, height] for the constructor of the axes object.
> The values for those four parts would be in the coordinate system of the
> figure object.

And this would not be super-hard.  Opposed to the automatical
solution.  I'm not familiar with pyplot etc., only with the API, but I
looked it up for you:
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axes

Notice that the tuple specifies the plot region, i.e. the
"decorations" like labels and tick labels are not included and will be
placed around.

You can also play with the Axes returned by the axes() call.  I.e. you
can shift them around, using:
http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.set_position.

Friedrich

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to