axis limits bug with twinx?

Hi,

I have problem setting the axis limits when using a twinx plot. I assume it should be possible to set both x-axis limits after a pylab.twinx() call by issuing only one call to pylab.axis.

The attached tries to plot the same figure in two different ways the first way ends up with different x axis limits for the two plots. The second shows my workaround.

/J�rgen

twin-bug.py (510 Bytes)

For some reason, when axis() is called, the "emit" flag (which determines whether to update all of the shared axes) was being set to False by default. There may be a good reason for this that I'm not aware of, but it seems reasonably harmless, and doesn't break the existing shared_axis examples. I've fixed this on the branch and the trunk, but I'm happy to revert if anyone says "stop, bad idea!!!"

Cheers,
Mike

J�rgen Stenarson wrote:

···

Hi,

I have problem setting the axis limits when using a twinx plot. I assume it should be possible to set both x-axis limits after a pylab.twinx() call by issuing only one call to pylab.axis.

The attached tries to plot the same figure in two different ways the first way ends up with different x axis limits for the two plots. The second shows my workaround.

/J�rgen

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

------------------------------------------------------------------------

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Michael Droettboom skrev:

For some reason, when axis() is called, the "emit" flag (which determines whether to update all of the shared axes) was being set to False by default. There may be a good reason for this that I'm not aware of, but it seems reasonably harmless, and doesn't break the existing shared_axis examples. I've fixed this on the branch and the trunk, but I'm happy to revert if anyone says "stop, bad idea!!!"

Works for me. Thanks!

/J�rgen