Thanks for the re-explanation. I can confirm that this is broken as
recently as 0.91.2. However, it works as expected with a recent SVN
trunk, and matplotlib 0.98.3.
It seems what this is doing is adjusting the limits twice (for each of
the twin axes), the first correctly, and then again by applying the same
rectangle to the adjusted limits.
I will go ahead and fix this on the 0.91.x maintenance branch. (It
seems Sourceforge's SVN is down at the moment, so I can't right now).
I've also attached a patch that *may* apply to 0.90.0. It's a lot of
work for me to move back to that version to test given the change in
Numpy dependencies etc. If the patch doesn't work for you, you may just
want to consider upgrading to the most recent 0.98.x.
Cheers,
Mike
wet_colored)arch wrote:
Can you be more specific about what is going wrong? The zoom magnifier
seems to work fine for me with or without twinx, but perhaps we just
have different expectations of how it works. Could you perhaps provide
screenshots?
Response>>
I confirmed it is 0.90.0 (I am running on Windows)
attached is code (which is simply example packaged with matplot lib)
ALSO:
the default figure: of which I selected the region from 2-4 on the x-axis
for magnifying
the resulting figure from magnifying: you can see much of the content from
2-4 is missing (I selected the entire y axis with the magnifier) -- the
xaxis is only selecting a subset of the range I chose
the expected figure: I used the crossed arrows instead of the magnifier to
create a plot figure that roughly mimics what I expected... I expected to
see all data in y from x = 2 to 4
Is my expectation wrong? I expect the x and y axis range selected by the
magnifier tool to be fully represented in the subsequent representation of
the data - it always seems to be subset of the data range chosen.
http://www.nabble.com/file/p20334562/two_scales.py two_scales.py
http://www.nabble.com/file/p20334562/two_scales_baseline.png
two_scales_baseline.png
http://www.nabble.com/file/p20334562/two_scales_2to4_concern.png
two_scales_2to4_concern.png
http://www.nabble.com/file/p20334562/two_scales_2to4_expectation.png
two_scales_2to4_expectation.png
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
Index: CHANGELOG
===================================================================
--- CHANGELOG (revision 6361)
+++ CHANGELOG (working copy)
@@ -1,2 +1,4 @@
+2008-11-05 Fix bug with zoom to rectangle and twin axes - MGD
+
2008-10-05 Fix problem with AFM files that don't specify the font's
full name or family name. - JKS
Index: lib/matplotlib/backend_bases.py
===================================================================
--- lib/matplotlib/backend_bases.py (revision 6361)
+++ lib/matplotlib/backend_bases.py (working copy)
@@ -1696,6 +1696,8 @@
for cur_xypress in self._xypress:
x, y = event.x, event.y
lastx, lasty, a, ind, lim, trans = cur_xypress
+ if a._sharex or a._sharey:
+ continue
# ignore singular clicks - 5 pixels is a threshold
if abs(x-lastx)<5 or abs(y-lasty)<5:
self._xypress = None
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users