Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1340615

Browse files
committed
fixed a zoom bug in sharex axis
svn path=/trunk/matplotlib/; revision=6447
1 parent 1e0a11a commit 1340615

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

lib/matplotlib/backend_bases.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def _iter_collection(self, path_ids, cliprect, clippath, clippath_trans,
269269
gc.set_alpha(rgbFace[-1])
270270
rgbFace = rgbFace[:3]
271271
gc.set_antialiased(antialiaseds[i % Naa])
272-
272+
273273
if Nurls:
274274
gc.set_url(urls[i % Nurls])
275275

@@ -527,7 +527,7 @@ def get_rgb(self):
527527
matlab format string, a html hex color string, or a rgb tuple
528528
"""
529529
return self._rgb
530-
530+
531531
def get_url(self):
532532
"""
533533
returns a url if one is set, None otherwise
@@ -633,7 +633,7 @@ def set_linestyle(self, style):
633633
raise ValueError('Unrecognized linestyle: %s' % style)
634634
self._linestyle = style
635635
self.set_dashes(offset, dashes)
636-
636+
637637
def set_url(self, url):
638638
"""
639639
Sets the url for links in compatible backends
@@ -1531,7 +1531,7 @@ def key_press(self, event):
15311531

15321532
if event.key == 'f':
15331533
self.full_screen_toggle()
1534-
1534+
15351535
# *h*ome or *r*eset mnemonic
15361536
elif event.key == 'h' or event.key == 'r' or event.key == "home":
15371537
self.canvas.toolbar.home()
@@ -1883,8 +1883,14 @@ def release_zoom(self, event):
18831883
for cur_xypress in self._xypress:
18841884
x, y = event.x, event.y
18851885
lastx, lasty, a, ind, lim, trans = cur_xypress
1886+
# JDH: I don't know why this is here but I expect to be
1887+
# able to zoomo on any axis that is shared. This was
1888+
# breaking zoom-to-rect on sharex_axis_demo if the zoom
1889+
# happened in ax2 or ax3 so i am replacing the continue
1890+
# with a pass until this is sorted out
18861891
if a._sharex or a._sharey:
1887-
continue
1892+
#continue
1893+
pass
18881894
# ignore singular clicks - 5 pixels is a threshold
18891895
if abs(x-lastx)<5 or abs(y-lasty)<5:
18901896
self._xypress = None

0 commit comments

Comments
 (0)