@@ -1601,7 +1601,8 @@ def apply_aspect(self, position=None):
1601
1601
self .set_xbound ((x0 , x1 ))
1602
1602
1603
1603
def axis (self , * v , ** kwargs ):
1604
- """Set axis properties.
1604
+ """
1605
+ Convenience method to get or set some axis properties.
1605
1606
1606
1607
Valid signatures::
1607
1608
@@ -1612,39 +1613,46 @@ def axis(self, *v, **kwargs):
1612
1613
1613
1614
Parameters
1614
1615
----------
1615
- v : list of float or {'on', 'off', 'equal', 'tight', 'scaled',\
1616
- 'normal', 'auto', 'image', 'square'}
1617
- Optional positional argument
1618
-
1619
- Axis data limits set from a list; or a command relating to axes:
1620
-
1621
- ========== ================================================
1622
- Value Description
1623
- ========== ================================================
1624
- 'on' Toggle axis lines and labels on
1625
- 'off' Toggle axis lines and labels off
1626
- 'equal' Equal scaling by changing limits
1627
- 'scaled' Equal scaling by changing box dimensions
1628
- 'tight' Limits set such that all data is shown
1629
- 'auto' Automatic scaling, fill rectangle with data
1630
- 'normal' Same as 'auto'; deprecated
1631
- 'image' 'scaled' with axis limits equal to data limits
1632
- 'square' Square plot; similar to 'scaled', but initially\
1633
- forcing xmax-xmin = ymax-ymin
1634
- ========== ================================================
1616
+ v : List[float] or one of the strings listed below.
1617
+ Optional positional-only argument
1618
+
1619
+ If a list, set the axis data limits. If a string:
1620
+
1621
+ ======== ==========================================================
1622
+ Value Description
1623
+ ======== ==========================================================
1624
+ 'on' Turn on axis lines and labels.
1625
+ 'off' Turn off axis lines and labels.
1626
+ 'equal' Set equal scaling (i.e., make circles circular) by
1627
+ changing axis limits.
1628
+ 'scaled' Set equal scaling (i.e., make circles circular) by
1629
+ changing dimensions of the plot box.
1630
+ 'tight' Set limits such that all data is shown; if this is already
1631
+ the case, move data to the center of the figure without
1632
+ modifying ``xmax-xmin`` or ``ymax-ymin``.
1633
+ 'auto' Automatic scaling (fill plot box with data).
1634
+ 'normal' Same as 'auto'; deprecated.
1635
+ 'image' 'scaled' with axis limits equal to data limits.
1636
+ 'square' Square plot; similar to 'scaled', but initially forcing
1637
+ ``xmax-xmin = ymax-ymin``.
1638
+ ======== ==========================================================
1635
1639
1636
1640
emit : bool, optional
1637
- Passed to set_{x,y}lim functions, if observers
1638
- are notified of axis limit change
1641
+ Passed to set_{x,y}lim functions, if observers are notified of axis
1642
+ limit change.
1639
1643
1640
1644
xmin, ymin, xmax, ymax : float, optional
1641
- The axis limits to be set
1645
+ The axis limits to be set.
1642
1646
1643
1647
Returns
1644
1648
-------
1645
1649
xmin, xmax, ymin, ymax : float
1646
- The axis limits
1650
+ The axis limits.
1647
1651
1652
+ See also
1653
+ --------
1654
+ matplotlib.axes.Axes.set_xlim
1655
+ matplotlib.axes.Axes.set_ylim
1648
1656
"""
1649
1657
1650
1658
if len (v ) == 0 and len (kwargs ) == 0 :
@@ -1765,18 +1773,19 @@ def get_yticklines(self):
1765
1773
# Adding and tracking artists
1766
1774
1767
1775
def _sci (self , im ):
1768
- """
1769
- helper for :func:`~matplotlib.pyplot.sci`;
1770
- do not use elsewhere.
1776
+ """Set the current image.
1777
+
1778
+ This image will be the target of colormap functions like
1779
+ `~matplotlib.pyplot.viridis`, and other functions such as
1780
+ `~matplotlib.pyplot.hot` or `~matplotlib.pyplot.clim`. The current
1781
+ image is an attribute of the current axes.
1771
1782
"""
1772
1783
if isinstance (im , matplotlib .contour .ContourSet ):
1773
1784
if im .collections [0 ] not in self .collections :
1774
- raise ValueError (
1775
- "ContourSet must be in current Axes" )
1785
+ raise ValueError ("ContourSet must be in current Axes" )
1776
1786
elif im not in self .images and im not in self .collections :
1777
- raise ValueError (
1778
- "Argument must be an image, collection, or ContourSet in "
1779
- "this Axes" )
1787
+ raise ValueError ("Argument must be an image, collection, or "
1788
+ "ContourSet in this Axes" )
1780
1789
self ._current_image = im
1781
1790
1782
1791
def _gci (self ):
@@ -3616,7 +3625,12 @@ def format_coord(self, x, y):
3616
3625
return 'x=%s y=%s' % (xs , ys )
3617
3626
3618
3627
def minorticks_on (self ):
3619
- 'Add autoscaling minor ticks to the axes.'
3628
+ """
3629
+ Display minor ticks on the axes.
3630
+
3631
+ Displaying minor ticks reduces performance; turn them off using
3632
+ `minorticks_off()` if drawing speed is a problem.
3633
+ """
3620
3634
for ax in (self .xaxis , self .yaxis ):
3621
3635
scale = ax .get_scale ()
3622
3636
if scale == 'log' :
0 commit comments