File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1054,10 +1054,14 @@ def xlim(*args, **kwargs):
1054
1054
xlim(xmax=3) # adjust the max leaving min unchanged
1055
1055
xlim(xmin=1) # adjust the min leaving max unchanged
1056
1056
1057
+ Setting limits turns autoscaling off for the x-axis.
1058
+
1057
1059
The new axis limits are returned as a length 2 tuple.
1058
1060
1059
1061
"""
1060
1062
ax = gca ()
1063
+ if not args and not kwargs :
1064
+ return ax .get_xlim ()
1061
1065
ret = ax .set_xlim (* args , ** kwargs )
1062
1066
draw_if_interactive ()
1063
1067
return ret
@@ -1077,9 +1081,13 @@ def ylim(*args, **kwargs):
1077
1081
ylim(ymax=3) # adjust the max leaving min unchanged
1078
1082
ylim(ymin=1) # adjust the min leaving max unchanged
1079
1083
1084
+ Setting limits turns autoscaling off for the y-axis.
1085
+
1080
1086
The new axis limits are returned as a length 2 tuple.
1081
1087
"""
1082
1088
ax = gca ()
1089
+ if not args and not kwargs :
1090
+ return ax .get_ylim ()
1083
1091
ret = ax .set_ylim (* args , ** kwargs )
1084
1092
draw_if_interactive ()
1085
1093
return ret
You can’t perform that action at this time.
0 commit comments