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

Skip to content

Commit da90260

Browse files
committed
Autogenerate more of pyplot.
1 parent 5a8f4ea commit da90260

File tree

3 files changed

+158
-284
lines changed

3 files changed

+158
-284
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,8 @@ def apply_aspect(self, position=None):
16011601
self.set_xbound((x0, x1))
16021602

16031603
def axis(self, *v, **kwargs):
1604-
"""Set axis properties.
1604+
"""
1605+
Convenience method to get or set some axis properties.
16051606
16061607
Valid signatures::
16071608
@@ -1612,39 +1613,46 @@ def axis(self, *v, **kwargs):
16121613
16131614
Parameters
16141615
----------
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+
======== ==========================================================
16351639
16361640
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.
16391643
16401644
xmin, ymin, xmax, ymax : float, optional
1641-
The axis limits to be set
1645+
The axis limits to be set.
16421646
16431647
Returns
16441648
-------
16451649
xmin, xmax, ymin, ymax : float
1646-
The axis limits
1650+
The axis limits.
16471651
1652+
See also
1653+
--------
1654+
matplotlib.axes.Axes.set_xlim
1655+
matplotlib.axes.Axes.set_ylim
16481656
"""
16491657

16501658
if len(v) == 0 and len(kwargs) == 0:
@@ -1765,18 +1773,19 @@ def get_yticklines(self):
17651773
# Adding and tracking artists
17661774

17671775
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.
17711782
"""
17721783
if isinstance(im, matplotlib.contour.ContourSet):
17731784
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")
17761786
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")
17801789
self._current_image = im
17811790

17821791
def _gci(self):
@@ -3616,7 +3625,12 @@ def format_coord(self, x, y):
36163625
return 'x=%s y=%s' % (xs, ys)
36173626

36183627
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+
"""
36203634
for ax in (self.xaxis, self.yaxis):
36213635
scale = ax.get_scale()
36223636
if scale == 'log':

0 commit comments

Comments
 (0)