@@ -511,7 +511,7 @@ def update_position(self, loc):
511
511
self .stale = True
512
512
513
513
def get_view_interval (self ):
514
- """Return the Interval instance for this axis view limits."""
514
+ # docstring inherited
515
515
return self .axes .viewLim .intervalx
516
516
517
517
@@ -895,24 +895,47 @@ def set_clip_path(self, clippath, transform=None):
895
895
self .stale = True
896
896
897
897
def get_view_interval (self ):
898
- 'return the Interval instance for this axis view limits'
898
+ """Return the Interval instance for this axis view limits."""
899
899
raise NotImplementedError ('Derived must override' )
900
900
901
901
def set_view_interval (self , vmin , vmax , ignore = False ):
902
+ """
903
+ Set the axis view limits. This method is for internal use; Matplotlib
904
+ users should typically use e.g. `~Axes.set_xlim` and `~Axes.set_ylim`.
905
+
906
+ If *ignore* is False (the default), this method will never reduce the
907
+ preexisting view limits, only expand them if *vmin* or *vmax* are not
908
+ within them. Moreover, the order of *vmin* and *vmax* does not matter;
909
+ the orientation of the axis will not change.
910
+
911
+ If *ignore* is True, the view limits will be set exactly to ``(vmin,
912
+ vmax)`` in that order.
913
+ """
902
914
raise NotImplementedError ('Derived must override' )
903
915
904
916
def get_data_interval (self ):
905
- 'return the Interval instance for this axis data limits'
917
+ """Return the Interval instance for this axis data limits."""
906
918
raise NotImplementedError ('Derived must override' )
907
919
908
- def set_data_interval (self ):
909
- '''set the axis data limits'''
920
+ def set_data_interval (self , vmin , vmax , ignore = False ):
921
+ """
922
+ Set the axis data limits. This method is for internal use.
923
+
924
+ If *ignore* is False (the default), this method will never reduce the
925
+ preexisting data limits, only expand them if *vmin* or *vmax* are not
926
+ within them. Moreover, the order of *vmin* and *vmax* does not matter;
927
+ the orientation of the axis will not change.
928
+
929
+ If *ignore* is True, the data limits will be set exactly to ``(vmin,
930
+ vmax)`` in that order.
931
+ """
910
932
raise NotImplementedError ('Derived must override' )
911
933
912
934
def set_default_intervals (self ):
913
- '''set the default limits for the axis data and view interval if they
914
- are not mutated'''
915
-
935
+ """
936
+ Set the default limits for the axis data and view interval if they
937
+ have not been not mutated yet.
938
+ """
916
939
# this is mainly in support of custom object plotting. For
917
940
# example, if someone passes in a datetime object, we do not
918
941
# know automagically how to set the default min/max of the
@@ -921,7 +944,6 @@ def set_default_intervals(self):
921
944
# default limits through the AxisInfo.default_limits
922
945
# attribute, and the derived code below will check for that
923
946
# and use it if is available (else just use 0..1)
924
- pass
925
947
926
948
def _set_artist_props (self , a ):
927
949
if a is None :
@@ -2028,19 +2050,11 @@ def get_ticks_position(self):
2028
2050
return "unknown"
2029
2051
2030
2052
def get_view_interval (self ):
2031
- 'return the Interval instance for this axis view limits'
2053
+ # docstring inherited
2032
2054
return self .axes .viewLim .intervalx
2033
2055
2034
2056
def set_view_interval (self , vmin , vmax , ignore = False ):
2035
- """
2036
- If *ignore* is *False*, the order of vmin, vmax
2037
- does not matter; the original axis orientation will
2038
- be preserved. In addition, the view limits can be
2039
- expanded, but will not be reduced. This method is
2040
- for mpl internal use; for normal use, see
2041
- :meth:`~matplotlib.axes.Axes.set_xlim`.
2042
-
2043
- """
2057
+ # docstring inherited
2044
2058
if ignore :
2045
2059
self .axes .viewLim .intervalx = vmin , vmax
2046
2060
else :
@@ -2056,11 +2070,11 @@ def get_minpos(self):
2056
2070
return self .axes .dataLim .minposx
2057
2071
2058
2072
def get_data_interval (self ):
2059
- 'return the Interval instance for this axis data limits'
2073
+ # docstring inherited
2060
2074
return self .axes .dataLim .intervalx
2061
2075
2062
2076
def set_data_interval (self , vmin , vmax , ignore = False ):
2063
- 'set the axis data limits'
2077
+ # docstring inherited
2064
2078
if ignore :
2065
2079
self .axes .dataLim .intervalx = vmin , vmax
2066
2080
else :
@@ -2069,7 +2083,7 @@ def set_data_interval(self, vmin, vmax, ignore=False):
2069
2083
self .stale = True
2070
2084
2071
2085
def set_default_intervals (self ):
2072
- 'set the default limits for the axis interval if they are not mutated'
2086
+ # docstring inherited
2073
2087
xmin , xmax = 0. , 1.
2074
2088
dataMutated = self .axes .dataLim .mutatedx ()
2075
2089
viewMutated = self .axes .viewLim .mutatedx ()
@@ -2412,19 +2426,11 @@ def get_ticks_position(self):
2412
2426
return 'unknown'
2413
2427
2414
2428
def get_view_interval (self ):
2415
- 'return the Interval instance for this axis view limits'
2429
+ # docstring inherited
2416
2430
return self .axes .viewLim .intervaly
2417
2431
2418
2432
def set_view_interval (self , vmin , vmax , ignore = False ):
2419
- """
2420
- If *ignore* is *False*, the order of vmin, vmax
2421
- does not matter; the original axis orientation will
2422
- be preserved. In addition, the view limits can be
2423
- expanded, but will not be reduced. This method is
2424
- for mpl internal use; for normal use, see
2425
- :meth:`~matplotlib.axes.Axes.set_ylim`.
2426
-
2427
- """
2433
+ # docstring inherited
2428
2434
if ignore :
2429
2435
self .axes .viewLim .intervaly = vmin , vmax
2430
2436
else :
@@ -2441,11 +2447,11 @@ def get_minpos(self):
2441
2447
return self .axes .dataLim .minposy
2442
2448
2443
2449
def get_data_interval (self ):
2444
- 'return the Interval instance for this axis data limits'
2450
+ # docstring inherited
2445
2451
return self .axes .dataLim .intervaly
2446
2452
2447
2453
def set_data_interval (self , vmin , vmax , ignore = False ):
2448
- 'set the axis data limits'
2454
+ # docstring inherited
2449
2455
if ignore :
2450
2456
self .axes .dataLim .intervaly = vmin , vmax
2451
2457
else :
@@ -2454,7 +2460,7 @@ def set_data_interval(self, vmin, vmax, ignore=False):
2454
2460
self .stale = True
2455
2461
2456
2462
def set_default_intervals (self ):
2457
- 'set the default limits for the axis interval if they are not mutated'
2463
+ # docstring inherited
2458
2464
ymin , ymax = 0. , 1.
2459
2465
dataMutated = self .axes .dataLim .mutatedy ()
2460
2466
viewMutated = self .axes .viewLim .mutatedy ()
0 commit comments