problem axis('scaled') with shared axis

Eric -

I found another problem that I cannot figure out.
I make an axis, and make it ‘scaled’.
Then I make a second axis that shares the x-axis with the first axis.
But then the y limits of the first axis change upon creation, and the ‘adjustable’ attribute!

I know for sure this used to work, but am not sure when it got changed.
What it used to do is that you could zoom nicely into the first axis (interactively), while the size of the shared axis changed with it. A thing of beauty I thought, and I loved showing it off. Do you think we can get that back?

Here’s a small example of the error:

from pylab import *
ax = axes([.1,.5,.8,.4])
plot([1,2,3])
[<matplotlib.lines.Line2D instance at 0x01C38800>]

axis(‘scaled’)
(0.0, 2.0, 1.0, 3.0)

ax.get_adjustable()
‘box’

ax2 = axes([.1,.1,.8,.3],sharex=ax)
ax.get_adjustable() # GOT CHANGED!
‘datalim’

Mark

Unit testing graphics packages can be hard, especially interactive
stuff like this, but I am a fan of poor man's unit testing here. When
you get something working like you like it, write an example that
generates several figures, and make the figure title an instruction to
the user, like: "zoom the image and the axes aspect should update" and
that way when other developers make changes down the road they can
make sure all the original features are preserved.

These scripts can be put into the units directory of the svn repository.

JDH

···

On 2/15/07, Mark Bakker <markbak@...287...> wrote:

I found another problem that I cannot figure out.
I make an axis, and make it 'scaled'.

This is a good idea.
I had done something like that for the original axis(‘equal’) and axis(‘scaled’) but I don’t think it is in the example directory anymore.
Once we get it to work again, I will make sure to do make an example and put it in the units directory.

And Yes, I realize testing this stuff in interactive mode is not easy.
Eric has done a very nice job rewriting my original stuff in an organized and much more comprehensive fashion. These are just some last minor issues that need to be fixed.

Mark

···

On 2/15/07, John Hunter <jdh2358@…287…> wrote:

On 2/15/07, Mark Bakker <markbak@…287…> wrote:

I found another problem that I cannot figure out.
I make an axis, and make it ‘scaled’.

Unit testing graphics packages can be hard, especially interactive

stuff like this, but I am a fan of poor man’s unit testing here. When
you get something working like you like it, write an example that
generates several figures, and make the figure title an instruction to

the user, like: “zoom the image and the axes aspect should update” and
that way when other developers make changes down the road they can
make sure all the original features are preserved.

These scripts can be put into the units directory of the svn repository.

JDH