@@ -1583,9 +1583,10 @@ def apply_aspect(self, position=None):
1583
1583
self .set_xbound ((x0 , x1 ))
1584
1584
1585
1585
def axis (self , * v , ** kwargs ):
1586
- """Set axis properties.
1586
+ """
1587
+ Convenience method to get or set some axis properties.
1587
1588
1588
- Valid signatures::
1589
+ Call signatures::
1589
1590
1590
1591
xmin, xmax, ymin, ymax = axis()
1591
1592
xmin, xmax, ymin, ymax = axis(list_arg)
@@ -1594,39 +1595,44 @@ def axis(self, *v, **kwargs):
1594
1595
1595
1596
Parameters
1596
1597
----------
1597
- v : list of float or {'on', 'off', 'equal', 'tight', 'scaled',\
1598
- 'normal', 'auto', 'image', 'square'}
1599
- Optional positional argument
1600
-
1601
- Axis data limits set from a list; or a command relating to axes:
1602
-
1603
- ========== ================================================
1604
- Value Description
1605
- ========== ================================================
1606
- 'on' Toggle axis lines and labels on
1607
- 'off' Toggle axis lines and labels off
1608
- 'equal' Equal scaling by changing limits
1609
- 'scaled' Equal scaling by changing box dimensions
1610
- 'tight' Limits set such that all data is shown
1611
- 'auto' Automatic scaling, fill rectangle with data
1612
- 'normal' Same as 'auto'; deprecated
1613
- 'image' 'scaled' with axis limits equal to data limits
1614
- 'square' Square plot; similar to 'scaled', but initially\
1615
- forcing xmax-xmin = ymax-ymin
1616
- ========== ================================================
1598
+ v : List[float] or one of the strings listed below.
1599
+ Optional positional-only argument
1600
+
1601
+ If a list, set the axis data limits. If a string:
1602
+
1603
+ ======== ==========================================================
1604
+ Value Description
1605
+ ======== ==========================================================
1606
+ 'on' Turn on axis lines and labels.
1607
+ 'off' Turn off axis lines and labels.
1608
+ 'equal' Set equal scaling (i.e., make circles circular) by
1609
+ changing axis limits.
1610
+ 'scaled' Set equal scaling (i.e., make circles circular) by
1611
+ changing dimensions of the plot box.
1612
+ 'tight' Set limits just large enough to show all data.
1613
+ 'auto' Automatic scaling (fill plot box with data).
1614
+ 'normal' Same as 'auto'; deprecated.
1615
+ 'image' 'scaled' with axis limits equal to data limits.
1616
+ 'square' Square plot; similar to 'scaled', but initially forcing
1617
+ ``xmax-xmin = ymax-ymin``.
1618
+ ======== ==========================================================
1617
1619
1618
1620
emit : bool, optional
1619
- Passed to set_{x,y}lim functions, if observers
1620
- are notified of axis limit change
1621
+ Passed to set_{x,y}lim functions, if observers are notified of axis
1622
+ limit change.
1621
1623
1622
1624
xmin, ymin, xmax, ymax : float, optional
1623
- The axis limits to be set
1625
+ The axis limits to be set.
1624
1626
1625
1627
Returns
1626
1628
-------
1627
1629
xmin, xmax, ymin, ymax : float
1628
- The axis limits
1630
+ The axis limits.
1629
1631
1632
+ See also
1633
+ --------
1634
+ matplotlib.axes.Axes.set_xlim
1635
+ matplotlib.axes.Axes.set_ylim
1630
1636
"""
1631
1637
1632
1638
if len (v ) == 0 and len (kwargs ) == 0 :
@@ -1747,18 +1753,18 @@ def get_yticklines(self):
1747
1753
# Adding and tracking artists
1748
1754
1749
1755
def _sci (self , im ):
1750
- """
1751
- helper for :func:`~matplotlib.pyplot.sci`;
1752
- do not use elsewhere.
1756
+ """Set the current image.
1757
+
1758
+ This image will be the target of colormap functions like
1759
+ `~.pyplot.viridis`, and other functions such as `~.pyplot.clim`. The
1760
+ current image is an attribute of the current axes.
1753
1761
"""
1754
1762
if isinstance (im , matplotlib .contour .ContourSet ):
1755
1763
if im .collections [0 ] not in self .collections :
1756
- raise ValueError (
1757
- "ContourSet must be in current Axes" )
1764
+ raise ValueError ("ContourSet must be in current Axes" )
1758
1765
elif im not in self .images and im not in self .collections :
1759
- raise ValueError (
1760
- "Argument must be an image, collection, or ContourSet in "
1761
- "this Axes" )
1766
+ raise ValueError ("Argument must be an image, collection, or "
1767
+ "ContourSet in this Axes" )
1762
1768
self ._current_image = im
1763
1769
1764
1770
def _gci (self ):
@@ -3598,7 +3604,12 @@ def format_coord(self, x, y):
3598
3604
return 'x=%s y=%s' % (xs , ys )
3599
3605
3600
3606
def minorticks_on (self ):
3601
- 'Add autoscaling minor ticks to the axes.'
3607
+ """
3608
+ Display minor ticks on the axes.
3609
+
3610
+ Displaying minor ticks may reduce performance; you may turn them off
3611
+ using `minorticks_off()` if drawing speed is a problem.
3612
+ """
3602
3613
for ax in (self .xaxis , self .yaxis ):
3603
3614
scale = ax .get_scale ()
3604
3615
if scale == 'log' :
0 commit comments