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

Skip to content

Commit e188fae

Browse files
authored
Merge pull request #10554 from anntzer/3dlim
Make ax3d.get_xlim() return a tuple, as 2D axes do.
2 parents 57c9a78 + dc3136e commit e188fae

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``Axes3D.get_xlim``, ``get_ylim`` and ``get_zlim`` now return a tuple
2+
`````````````````````````````````````````````````````````````````````
3+
4+
They previously returned an array. Returning a tuple is consistent with the
5+
behavior for 2D axes.

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ def set_zlim3d(self, bottom=None, top=None, emit=True, auto=False, **kw):
761761
set_zlim = set_zlim3d
762762

763763
def get_xlim3d(self):
764-
return self.xy_viewLim.intervalx
764+
return tuple(self.xy_viewLim.intervalx)
765765
get_xlim3d.__doc__ = maxes.Axes.get_xlim.__doc__
766766
get_xlim = get_xlim3d
767767
if get_xlim.__doc__ is not None:
@@ -771,7 +771,7 @@ def get_xlim3d(self):
771771
"""
772772

773773
def get_ylim3d(self):
774-
return self.xy_viewLim.intervaly
774+
return tuple(self.xy_viewLim.intervaly)
775775
get_ylim3d.__doc__ = maxes.Axes.get_ylim.__doc__
776776
get_ylim = get_ylim3d
777777
if get_ylim.__doc__ is not None:
@@ -782,7 +782,7 @@ def get_ylim3d(self):
782782

783783
def get_zlim3d(self):
784784
'''Get 3D z limits.'''
785-
return self.zz_viewLim.intervalx
785+
return tuple(self.zz_viewLim.intervalx)
786786
get_zlim = get_zlim3d
787787

788788
def get_zscale(self):

0 commit comments

Comments
 (0)