Chao YUE | 6 Jul 2012 23:39
Picon

clean way to build subplots with sharex only on same colomn and sharey only on same row?

dear all,

I want to build a 5X3 subplots matrix that I want the xaxis is shared only on the same column and yaxis shared only on the same row.
While using plt.subplots(5,3,sharex=True, sharey=True) will put all subplots as both shared xaxis and yaxis.

The other option is to do like this to create 2X2 subplots with desired feature, Yet I guess doing the same for 5X3 subplots could be tedious?
Does anyone has some idea?
 fig=figure()
ax1=fig.add_subplot(221)
ax2=fig.add_subplot(222,sharey=ax1)
ax3=fig.add_subplot(223,sharex=ax1)
ax4=fig.add_subplot(224,sharex=ax2,sharey=ax3)

Thanks a lot et cheers,

Chao

--

***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Benjamin Root | 7 Jul 2012 18:06
Picon
Favicon

Re: clean way to build subplots with sharex only on same colomn and sharey only on same row?



On Fri, Jul 6, 2012 at 5:39 PM, Chao YUE <chaoyuejoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
dear all,

I want to build a 5X3 subplots matrix that I want the xaxis is shared only on the same column and yaxis shared only on the same row.
While using plt.subplots(5,3,sharex=True, sharey=True) will put all subplots as both shared xaxis and yaxis.

The other option is to do like this to create 2X2 subplots with desired feature, Yet I guess doing the same for 5X3 subplots could be tedious?
Does anyone has some idea?
 fig=figure()
ax1=fig.add_subplot(221)
ax2=fig.add_subplot(222,sharey=ax1)
ax3=fig.add_subplot(223,sharex=ax1)
ax4=fig.add_subplot(224,sharex=ax2,sharey=ax3)

Thanks a lot et cheers,

Chao


Chao,

Such a feature is not in any of the current releases, (although it can be done manually, but it is tedious).  However, in the development branch, the subplots() function now accepts strings of "row", "col", "all", or "none" for both the sharex and sharey kwargs.  So, for you, you can call subplots() with sharex="col" and sharey="row" to get what you want.  This will also have a side-effect of having the y-tick labels show up only on the first column and the x-tick labels show up only on the last row.  This is a new feature, so bug reports would be welcomed!

Cheers!
Ben Root

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Chao YUE | 10 Jul 2012 10:27
Picon

Re: clean way to build subplots with sharex only on same colomn and sharey only on same row?

Hi Ben,

I tried it.  Installing the development version is much easier than I expect.
and the subplots() function works very well as expect. it's too awesome. thanks a lot.

cheers,

Chao

2012/7/7 Benjamin Root <ben.root-GrrYUJ3DTa8@public.gmane.org>


On Fri, Jul 6, 2012 at 5:39 PM, Chao YUE <chaoyuejoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
dear all,

I want to build a 5X3 subplots matrix that I want the xaxis is shared only on the same column and yaxis shared only on the same row.
While using plt.subplots(5,3,sharex=True, sharey=True) will put all subplots as both shared xaxis and yaxis.

The other option is to do like this to create 2X2 subplots with desired feature, Yet I guess doing the same for 5X3 subplots could be tedious?
Does anyone has some idea?
 fig=figure()
ax1=fig.add_subplot(221)
ax2=fig.add_subplot(222,sharey=ax1)
ax3=fig.add_subplot(223,sharex=ax1)
ax4=fig.add_subplot(224,sharex=ax2,sharey=ax3)

Thanks a lot et cheers,

Chao


Chao,

Such a feature is not in any of the current releases, (although it can be done manually, but it is tedious).  However, in the development branch, the subplots() function now accepts strings of "row", "col", "all", or "none" for both the sharex and sharey kwargs.  So, for you, you can call subplots() with sharex="col" and sharey="row" to get what you want.  This will also have a side-effect of having the y-tick labels show up only on the first column and the x-tick labels show up only on the last row.  This is a new feature, so bug reports would be welcomed!

Cheers!
Ben Root




--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Gmane