|
From: Benjamin R. <ben...@ou...> - 2011-01-24 23:56:52
|
On Monday, January 24, 2011, Russell Hewett <rhe...@il...> wrote:
> Worked great, thanks!
>
> -r
>
> On Mon, Jan 24, 2011 at 2:32 PM, Paul Ivanov <piv...@gm...> wrote:
>
> Russell Hewett, on 2011-01-24 13:56, wrote:
>> Hi All,
>>
>> I can't get the x label on the top row of an ImageGrid to display if there
>> is more than one row in the grid. I suspect that something is being clipped
>> somewhere, but have no idea what to do to fix it. (Note, this also happens
>> on the right edge of a ride-sided y axis label.)
>>
>> I have included some minimal sample code below. I'd appreciate it if anyone
>> can point me in the right direction.
>>
>>
>> Cheers,
>> Russ
>
> Hi Russ,
>
> thanks for the report - at a glance, it appears to be a bug in
> AxesGrid removing redundant labels for shared axis when they
> align. I've included a temporary workaround for your script, but
> don't have time to look into it further at the moment. By the
> way, calling grid[0].axes is redundant, so I just modified it to
> use grid[0].xaxis, which is equivalent.
>
> #-------------------------------
> import matplotlib.pyplot as plt
> import matplotlib.cm as cm
> import mpl_toolkits.axes_grid1 as ag
>
> import numpy as np
>
> fig1 = plt.figure()
>
> grid1 = ag.AxesGrid( fig1, 111, nrows_ncols = (1,2), axes_pad = 0.5)
>
> grid1[0].xaxis.set_label_position('top')
> grid1[0].xaxis.set_label_text('foo')
>
> grid1[1].xaxis.set_label_position('top')
> grid1[1].xaxis.set_label_text('bar')
>
> grid1[0].yaxis.set_label_position('right')
> grid1[0].yaxis.set_label_text('foo')
>
> grid1[1].yaxis.set_label_position('right')
> grid1[1].yaxis.set_label_text('bar')
> grid1[1].yaxis.label.set_visible(True) # tmp workaround
>
>
> fig2 = plt.figure()
> grid2 = ag.AxesGrid( fig2, 111, nrows_ncols = (2,1), axes_pad = 0.5)
>
> grid2[0].xaxis.set_label_position('top')
> grid2[0].xaxis.set_label_text('bar')
> grid2[0].xaxis.label.set_visible(True) # tmp workaround
>
> grid2[1].xaxis.set_label_position('top')
> grid2[1].xaxis.set_label_text('bar')
>
> grid2[0].yaxis.set_label_position('right')
> grid2[0].yaxis.set_label_text('foo')
>
> grid2[1].yaxis.set_label_position('right')
> grid2[1].yaxis.set_label_text('bar')
>
> plt.show()
> #-------------------------------
>
> best,
> --
> Paul Ivanov
> 314 address only used for lists, off-list direct email at:
> http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk094eYACgkQe+cmRQ8+KPc/qACePreDR4ThGj/2PttN6OaMXm0K
> 17YAmwbIpf+++7fYVqI3asKiBf8Z3zlT
> =eG7W
> -----END PGP SIGNATURE-----
>
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> --
> Russell J. Hewett
> Ph.D. Candidate
> Department of Computer Science
> University of Illinois at Urbana-Champaign
> www.russellhewett.com
>
>
Isn't it a feature? Axes_grid lets you choose the label mode which is
'L' by default. This means that only the outer labels are shown. Or
am I missing something in the description of the problem?
Ben Root
|