Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e4ce92f

Browse filesBrowse files
authored
Merge pull request #10934 from anntzer/more-autogen
Autogenerate (via boilerplate) more of pyplot.
2 parents f1a988f + b517e51 commit e4ce92f
Copy full SHA for e4ce92f

File tree

Expand file treeCollapse file tree

3 files changed

+154
-284
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+154
-284
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+46-35Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,9 +1598,10 @@ def apply_aspect(self, position=None):
15981598
self.set_xbound((x0, x1))
15991599

16001600
def axis(self, *v, **kwargs):
1601-
"""Set axis properties.
1601+
"""
1602+
Convenience method to get or set some axis properties.
16021603
1603-
Valid signatures::
1604+
Call signatures::
16041605
16051606
xmin, xmax, ymin, ymax = axis()
16061607
xmin, xmax, ymin, ymax = axis(list_arg)
@@ -1609,39 +1610,44 @@ def axis(self, *v, **kwargs):
16091610
16101611
Parameters
16111612
----------
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+
======== ==========================================================
16321634
16331635
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.
16361638
16371639
xmin, ymin, xmax, ymax : float, optional
1638-
The axis limits to be set
1640+
The axis limits to be set.
16391641
16401642
Returns
16411643
-------
16421644
xmin, xmax, ymin, ymax : float
1643-
The axis limits
1645+
The axis limits.
16441646
1647+
See also
1648+
--------
1649+
matplotlib.axes.Axes.set_xlim
1650+
matplotlib.axes.Axes.set_ylim
16451651
"""
16461652

16471653
if len(v) == 0 and len(kwargs) == 0:
@@ -1762,18 +1768,18 @@ def get_yticklines(self):
17621768
# Adding and tracking artists
17631769

17641770
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.
17681776
"""
17691777
if isinstance(im, matplotlib.contour.ContourSet):
17701778
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")
17731780
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")
17771783
self._current_image = im
17781784

17791785
def _gci(self):
@@ -3674,7 +3680,12 @@ def format_coord(self, x, y):
36743680
return 'x=%s y=%s' % (xs, ys)
36753681

36763682
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+
"""
36783689
for ax in (self.xaxis, self.yaxis):
36793690
scale = ax.get_scale()
36803691
if scale == 'log':

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.