File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1054,10 +1054,14 @@ def xlim(*args, **kwargs):
10541054 xlim(xmax=3) # adjust the max leaving min unchanged
10551055 xlim(xmin=1) # adjust the min leaving max unchanged
10561056
1057+ Setting limits turns autoscaling off for the x-axis.
1058+
10571059 The new axis limits are returned as a length 2 tuple.
10581060
10591061 """
10601062 ax = gca ()
1063+ if not args and not kwargs :
1064+ return ax .get_xlim ()
10611065 ret = ax .set_xlim (* args , ** kwargs )
10621066 draw_if_interactive ()
10631067 return ret
@@ -1077,9 +1081,13 @@ def ylim(*args, **kwargs):
10771081 ylim(ymax=3) # adjust the max leaving min unchanged
10781082 ylim(ymin=1) # adjust the min leaving max unchanged
10791083
1084+ Setting limits turns autoscaling off for the y-axis.
1085+
10801086 The new axis limits are returned as a length 2 tuple.
10811087 """
10821088 ax = gca ()
1089+ if not args and not kwargs :
1090+ return ax .get_ylim ()
10831091 ret = ax .set_ylim (* args , ** kwargs )
10841092 draw_if_interactive ()
10851093 return ret
You can’t perform that action at this time.
0 commit comments