Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit15ddfa9

Browse files
committed
Add units kwarg to 3D (x,y,z)lim
1 parent8b78c90 commit15ddfa9

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

‎lib/mpl_toolkits/mplot3d/axes3d.py‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,12 @@ def set_zlim3d(self, bottom=None, top=None, emit=True, auto=False,
769769
returnbottom,top
770770
set_zlim=set_zlim3d
771771

772-
defget_xlim3d(self):
772+
defget_xlim3d(self,units=True):
773+
ifunits:
774+
returnself._convert_back_lim(
775+
self.xy_viewLim.intervalx,self.xaxis)
773776
returntuple(self.xy_viewLim.intervalx)
777+
774778
get_xlim3d.__doc__=maxes.Axes.get_xlim.__doc__
775779
get_xlim=get_xlim3d
776780
ifget_xlim.__doc__isnotNone:
@@ -779,8 +783,12 @@ def get_xlim3d(self):
779783
This function now correctly refers to the 3D x-limits
780784
"""
781785

782-
defget_ylim3d(self):
786+
defget_ylim3d(self,units=True):
787+
ifunits:
788+
returnself._convert_back_lim(
789+
self.xy_viewLim.intervaly,self.yaxis)
783790
returntuple(self.xy_viewLim.intervaly)
791+
784792
get_ylim3d.__doc__=maxes.Axes.get_ylim.__doc__
785793
get_ylim=get_ylim3d
786794
ifget_ylim.__doc__isnotNone:
@@ -789,8 +797,24 @@ def get_ylim3d(self):
789797
This function now correctly refers to the 3D y-limits.
790798
"""
791799

792-
defget_zlim3d(self):
793-
'''Get 3D z limits.'''
800+
defget_zlim3d(self,units=True):
801+
'''
802+
Get 3D z limits.
803+
804+
Parameters
805+
----------
806+
units : bool, optional
807+
If *True*, return limits with units attached.
808+
809+
Returns
810+
-------
811+
zlimits : tuple
812+
Returns the current z-axis limits as the tuple
813+
``(z0, z1)``.
814+
'''
815+
ifunits:
816+
returnself._convert_back_lim(
817+
self.zz_viewLim.intervalx,self.zaxis)
794818
returntuple(self.zz_viewLim.intervalx)
795819
get_zlim=get_zlim3d
796820

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp