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

Skip to content

Commit ac2f0d0

Browse files
committed
Trivial simplification to Axis3d._get_coord_info.
1 parent 1a0a0bf commit ac2f0d0

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lib/mpl_toolkits/mplot3d/axis3d.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,11 @@ def get_rotate_label(self, text):
176176
return len(text) > 4
177177

178178
def _get_coord_info(self, renderer):
179-
minx, maxx, miny, maxy, minz, maxz = self.axes.get_w_lims()
180-
if minx > maxx:
181-
minx, maxx = maxx, minx
182-
if miny > maxy:
183-
miny, maxy = maxy, miny
184-
if minz > maxz:
185-
minz, maxz = maxz, minz
186-
mins = np.array((minx, miny, minz))
187-
maxs = np.array((maxx, maxy, maxz))
179+
mins, maxs = np.array([
180+
self.axes.get_xbound(),
181+
self.axes.get_ybound(),
182+
self.axes.get_zbound(),
183+
]).T
188184
centers = (maxs + mins) / 2.
189185
deltas = (maxs - mins) / 12.
190186
mins = mins - deltas / 4.

0 commit comments

Comments
 (0)