Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89b09cc

Browse files
committed
Autogenerate more of pyplot.
1 parent d9b5b4e commit 89b09cc

File tree

3 files changed

+156
-285
lines changed

3 files changed

+156
-285
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,9 +1583,10 @@ def apply_aspect(self, position=None):
15831583
self.set_xbound((x0, x1))
15841584

15851585
def axis(self, *v, **kwargs):
1586-
"""Set axis properties.
1586+
"""
1587+
Convenience method to get or set some axis properties.
15871588
1588-
Valid signatures::
1589+
Call signatures::
15891590
15901591
xmin, xmax, ymin, ymax = axis()
15911592
xmin, xmax, ymin, ymax = axis(list_arg)
@@ -1594,39 +1595,44 @@ def axis(self, *v, **kwargs):
15941595
15951596
Parameters
15961597
----------
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+
======== ==========================================================
16171619
16181620
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.
16211623
16221624
xmin, ymin, xmax, ymax : float, optional
1623-
The axis limits to be set
1625+
The axis limits to be set.
16241626
16251627
Returns
16261628
-------
16271629
xmin, xmax, ymin, ymax : float
1628-
The axis limits
1630+
The axis limits.
16291631
1632+
See also
1633+
--------
1634+
matplotlib.axes.Axes.set_xlim
1635+
matplotlib.axes.Axes.set_ylim
16301636
"""
16311637

16321638
if len(v) == 0 and len(kwargs) == 0:
@@ -1747,18 +1753,18 @@ def get_yticklines(self):
17471753
# Adding and tracking artists
17481754

17491755
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.
17531761
"""
17541762
if isinstance(im, matplotlib.contour.ContourSet):
17551763
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")
17581765
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")
17621768
self._current_image = im
17631769

17641770
def _gci(self):
@@ -3598,7 +3604,12 @@ def format_coord(self, x, y):
35983604
return 'x=%s y=%s' % (xs, ys)
35993605

36003606
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+
"""
36023613
for ax in (self.xaxis, self.yaxis):
36033614
scale = ax.get_scale()
36043615
if scale == 'log':

0 commit comments

Comments
 (0)