@@ -1598,9 +1598,10 @@ def apply_aspect(self, position=None):
1598
1598
self .set_xbound ((x0 , x1 ))
1599
1599
1600
1600
def axis (self , * v , ** kwargs ):
1601
- """Set axis properties.
1601
+ """
1602
+ Convenience method to get or set some axis properties.
1602
1603
1603
- Valid signatures::
1604
+ Call signatures::
1604
1605
1605
1606
xmin, xmax, ymin, ymax = axis()
1606
1607
xmin, xmax, ymin, ymax = axis(list_arg)
@@ -1609,39 +1610,44 @@ def axis(self, *v, **kwargs):
1609
1610
1610
1611
Parameters
1611
1612
----------
1612
- v : list of float or {'on', 'off', 'equal', 'tight', 'scaled',\
1613
- 'normal', 'auto', 'image', 'square'}
1614
- Optional positional argument
1615
-
1616
- Axis data limits set from a list; or a command relating to axes:
1617
-
1618
- ========== ================================================
1619
- Value Description
1620
- ========== ================================================
1621
- 'on' Toggle axis lines and labels on
1622
- 'off' Toggle axis lines and labels off
1623
- 'equal' Equal scaling by changing limits
1624
- 'scaled' Equal scaling by changing box dimensions
1625
- 'tight' Limits set such that all data is shown
1626
- 'auto' Automatic scaling, fill rectangle with data
1627
- 'normal' Same as 'auto'; deprecated
1628
- 'image' 'scaled' with axis limits equal to data limits
1629
- 'square' Square plot; similar to 'scaled', but initially\
1630
- forcing xmax-xmin = ymax-ymin
1631
- ========== ================================================
1613
+ v : List[float] or one of the strings listed below.
1614
+ Optional positional-only argument
1615
+
1616
+ If a list, set the axis data limits. If a string:
1617
+
1618
+ ======== ==========================================================
1619
+ Value Description
1620
+ ======== ==========================================================
1621
+ 'on' Turn on axis lines and labels.
1622
+ 'off' Turn off axis lines and labels.
1623
+ 'equal' Set equal scaling (i.e., make circles circular) by
1624
+ changing axis limits.
1625
+ 'scaled' Set equal scaling (i.e., make circles circular) by
1626
+ changing dimensions of the plot box.
1627
+ 'tight' Set limits just large enough to show all data.
1628
+ 'auto' Automatic scaling (fill plot box with data).
1629
+ 'normal' Same as 'auto'; deprecated.
1630
+ 'image' 'scaled' with axis limits equal to data limits.
1631
+ 'square' Square plot; similar to 'scaled', but initially forcing
1632
+ ``xmax-xmin = ymax-ymin``.
1633
+ ======== ==========================================================
1632
1634
1633
1635
emit : bool, optional
1634
- Passed to set_{x,y}lim functions, if observers
1635
- are notified of axis limit change
1636
+ Passed to set_{x,y}lim functions, if observers are notified of axis
1637
+ limit change.
1636
1638
1637
1639
xmin, ymin, xmax, ymax : float, optional
1638
- The axis limits to be set
1640
+ The axis limits to be set.
1639
1641
1640
1642
Returns
1641
1643
-------
1642
1644
xmin, xmax, ymin, ymax : float
1643
- The axis limits
1645
+ The axis limits.
1644
1646
1647
+ See also
1648
+ --------
1649
+ matplotlib.axes.Axes.set_xlim
1650
+ matplotlib.axes.Axes.set_ylim
1645
1651
"""
1646
1652
1647
1653
if len (v ) == 0 and len (kwargs ) == 0 :
@@ -1762,18 +1768,18 @@ def get_yticklines(self):
1762
1768
# Adding and tracking artists
1763
1769
1764
1770
def _sci (self , im ):
1765
- """
1766
- helper for :func:`~matplotlib.pyplot.sci`;
1767
- do not use elsewhere.
1771
+ """Set the current image.
1772
+
1773
+ This image will be the target of colormap functions like
1774
+ `~.pyplot.viridis`, and other functions such as `~.pyplot.clim`. The
1775
+ current image is an attribute of the current axes.
1768
1776
"""
1769
1777
if isinstance (im , matplotlib .contour .ContourSet ):
1770
1778
if im .collections [0 ] not in self .collections :
1771
- raise ValueError (
1772
- "ContourSet must be in current Axes" )
1779
+ raise ValueError ("ContourSet must be in current Axes" )
1773
1780
elif im not in self .images and im not in self .collections :
1774
- raise ValueError (
1775
- "Argument must be an image, collection, or ContourSet in "
1776
- "this Axes" )
1781
+ raise ValueError ("Argument must be an image, collection, or "
1782
+ "ContourSet in this Axes" )
1777
1783
self ._current_image = im
1778
1784
1779
1785
def _gci (self ):
@@ -3674,7 +3680,12 @@ def format_coord(self, x, y):
3674
3680
return 'x=%s y=%s' % (xs , ys )
3675
3681
3676
3682
def minorticks_on (self ):
3677
- 'Add autoscaling minor ticks to the axes.'
3683
+ """
3684
+ Display minor ticks on the axes.
3685
+
3686
+ Displaying minor ticks may reduce performance; you may turn them off
3687
+ using `minorticks_off()` if drawing speed is a problem.
3688
+ """
3678
3689
for ax in (self .xaxis , self .yaxis ):
3679
3690
scale = ax .get_scale ()
3680
3691
if scale == 'log' :
0 commit comments