New subplots from 1.0 + shared axis

Hello list,

I enjoyed the new feature:
fig, axarr = plt.subplots(2, 2)

However, I failed to understand how to use the shared axis option with this new feature.

The docstring for sunplots has the "sharex(y) option", but my "ax" are being created now!? Is that a chicken and egg problem? Or I'm failing to understand the logic here.

Thanks, Filipe.

Don't worry: when you indicate that you want to share axes (x or y),
subplots() tracks that and enables it as it creates the axis objects.
Give it a try and see if it works :slight_smile:

Cheers,

f

···

On Mon, Aug 9, 2010 at 8:48 AM, Filipe Fernandes <ocefpaf@...287...> wrote:

The docstring for sunplots has the "sharex(y) option", but my "ax" are
being created now!? Is that a chicken and egg problem? Or I'm failing to
understand the logic here.

Great, just now I realized that the option is sharex(y)=True/False and
no longer sharex=ax1.
It sacrifice a more fine control, but simplify the processes for the
majority of the plots that I produce.

Thanks!

···

On Mon, Aug 9, 2010 at 12:22, Fernando Perez <fperez.net@...287...> wrote:

On Mon, Aug 9, 2010 at 8:48 AM, Filipe Fernandes <ocefpaf@...287...> wrote:

The docstring for sunplots has the "sharex(y) option", but my "ax" are
being created now!? Is that a chicken and egg problem? Or I'm failing to
understand the logic here.

Don't worry: when you indicate that you want to share axes (x or y),
subplots() tracks that and enables it as it creates the axis objects.
Give it a try and see if it works :slight_smile:

Cheers,

f

Yes, that was the idea. We figured that if you need very fine-grained
control over axis sharing in complex ways, you're probably OK using
the manual API. But for the vast majority of users this seemed like a
decent solution.

It could in the long run be extended to allow passing of a list of
axis indices to activate sharing for x/y on, though. Patches welcome
:slight_smile:

Cheers,

f

···

On Mon, Aug 9, 2010 at 11:49 AM, Filipe Pires Alvarenga Fernandes <ocefpaf@...287...> wrote:

It sacrifice a more fine control, but simplify the processes for the
majority of the plots that I produce.