Skip to content

Commit 206b16c

Browse files
committed
added gregorys zoom patch
svn path=/trunk/matplotlib/; revision=720
1 parent 0a5c83b commit 206b16c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,20 +1080,20 @@ def release_zoom(self, event):
10801080

10811081
# zoom to rect
10821082
lastx, lasty = a.transData.inverse_xy_tup( (lastx, lasty) )
1083-
x, y = a.transData.inverse_xy_tup( (x, y) )
1083+
x, y = a.transData.inverse_xy_tup( (x, y) )
1084+
Xmin,Xmax=a.get_xlim()
1085+
Ymin,Ymax=a.get_ylim()
10841086

1085-
if x<lastx: xmin, xmax = x, lastx
1087+
if (x<lastx and Xmin<Xmax) or (x>lastx and Xmin>Xmax): xmin, xmax = x, lastx
10861088
else: xmin, xmax = lastx, x
10871089

1088-
if y<lasty: ymin, ymax = y, lasty
1090+
if (y<lasty and Ymin<Ymax) or (y>lasty and Ymin>Ymax): ymin, ymax = y, lasty
10891091
else: ymin, ymax = lasty, y
10901092

10911093
if self._button_pressed == 1:
10921094
a.set_xlim((xmin, xmax))
10931095
a.set_ylim((ymin, ymax))
10941096
elif self._button_pressed == 3:
1095-
Xmin,Xmax=a.get_xlim()
1096-
Ymin,Ymax=a.get_ylim()
10971097
if a.get_xscale()=='log':
10981098
alpha=log(Xmax/Xmin)/log(xmax/xmin)
10991099
x1=pow(Xmin/xmin,alpha)*Xmin

lib/matplotlib/lines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def set_linewidth(self, w):
353353
"""
354354
Set the line width in points
355355
356-
ACCEPTS: float
356+
ACCEPTS: float value in points
357357
"""
358358
self._linewidth = w
359359

@@ -388,7 +388,7 @@ def set_markeredgewidth(self, ew):
388388
"""
389389
Set the marker edge width in points
390390
391-
ACCEPTS: float
391+
ACCEPTS: float value in points
392392
"""
393393
self._markeredgewidth = ew
394394

0 commit comments

Comments
 (0)