Skip to content

Commit 1ea7cce

Browse files
committed
PEP8ify _set_view_from_bbox.
1 parent 57489bf commit 1ea7cce

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4292,33 +4292,24 @@ def _set_view_from_bbox(self, bbox, direction='in',
42924292
Whether this axis is twinned in the *y*-direction.
42934293
"""
42944294
if len(bbox) == 3:
4295-
Xmin, Xmax = self.get_xlim()
4296-
Ymin, Ymax = self.get_ylim()
4297-
42984295
xp, yp, scl = bbox # Zooming code
4299-
43004296
if scl == 0: # Should not happen
43014297
scl = 1.
4302-
43034298
if scl > 1:
43044299
direction = 'in'
43054300
else:
43064301
direction = 'out'
43074302
scl = 1/scl
4308-
43094303
# get the limits of the axes
4310-
tranD2C = self.transData.transform
4311-
xmin, ymin = tranD2C((Xmin, Ymin))
4312-
xmax, ymax = tranD2C((Xmax, Ymax))
4313-
4304+
(xmin, ymin), (xmax, ymax) = self.transData.transform(
4305+
np.transpose([self.get_xlim(), self.get_ylim()]))
43144306
# set the range
43154307
xwidth = xmax - xmin
43164308
ywidth = ymax - ymin
43174309
xcen = (xmax + xmin)*.5
43184310
ycen = (ymax + ymin)*.5
43194311
xzc = (xp*(scl - 1) + xcen)/scl
43204312
yzc = (yp*(scl - 1) + ycen)/scl
4321-
43224313
bbox = [xzc - xwidth/2./scl, yzc - ywidth/2./scl,
43234314
xzc + xwidth/2./scl, yzc + ywidth/2./scl]
43244315
elif len(bbox) != 4:

0 commit comments

Comments
 (0)