Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitccdf863

Browse files
committed
Autogenerate more of pyplot.
1 parentd9b5b4e commitccdf863

File tree

3 files changed

+158
-285
lines changed

3 files changed

+158
-285
lines changed

‎lib/matplotlib/axes/_base.py

Lines changed: 48 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
defaxis(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,46 @@ 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 such that all data is shown; if this is already
1613+
the case, move data to the center of the figure without
1614+
modifying ``xmax-xmin`` or ``ymax-ymin``.
1615+
'auto' Automatic scaling (fill plot box with data).
1616+
'normal' Same as 'auto'; deprecated.
1617+
'image' 'scaled' with axis limits equal to data limits.
1618+
'square' Square plot; similar to 'scaled', but initially forcing
1619+
``xmax-xmin = ymax-ymin``.
1620+
======== ==========================================================
16171621
16181622
emit : bool, optional
1619-
Passed to set_{x,y}lim functions, if observers
1620-
are notified of axislimit change
1623+
Passed to set_{x,y}lim functions, if observers are notified of axis
1624+
limit change.
16211625
16221626
xmin, ymin, xmax, ymax : float, optional
1623-
The axis limits to be set
1627+
The axis limits to be set.
16241628
16251629
Returns
16261630
-------
16271631
xmin, xmax, ymin, ymax : float
1628-
The axis limits
1632+
The axis limits.
16291633
1634+
See also
1635+
--------
1636+
matplotlib.axes.Axes.set_xlim
1637+
matplotlib.axes.Axes.set_ylim
16301638
"""
16311639

16321640
iflen(v)==0andlen(kwargs)==0:
@@ -1747,18 +1755,18 @@ def get_yticklines(self):
17471755
# Adding and tracking artists
17481756

17491757
def_sci(self,im):
1750-
"""
1751-
helper for :func:`~matplotlib.pyplot.sci`;
1752-
do not use elsewhere.
1758+
"""Set the current image.
1759+
1760+
This image will be the target of colormap functions like
1761+
`~.pyplot.viridis`, and other functions such as `~.pyplot.clim`. The
1762+
current image is an attribute of the current axes.
17531763
"""
17541764
ifisinstance(im,matplotlib.contour.ContourSet):
17551765
ifim.collections[0]notinself.collections:
1756-
raiseValueError(
1757-
"ContourSet must be in current Axes")
1766+
raiseValueError("ContourSet must be in current Axes")
17581767
elifimnotinself.imagesandimnotinself.collections:
1759-
raiseValueError(
1760-
"Argument must be an image, collection, or ContourSet in "
1761-
"this Axes")
1768+
raiseValueError("Argument must be an image, collection, or "
1769+
"ContourSet in this Axes")
17621770
self._current_image=im
17631771

17641772
def_gci(self):
@@ -3598,7 +3606,12 @@ def format_coord(self, x, y):
35983606
return'x=%s y=%s'% (xs,ys)
35993607

36003608
defminorticks_on(self):
3601-
'Add autoscaling minor ticks to the axes.'
3609+
"""
3610+
Display minor ticks on the axes.
3611+
3612+
Displaying minor ticks may reduce performance; you may turn them off
3613+
using `minorticks_off()` if drawing speed is a problem.
3614+
"""
36023615
foraxin (self.xaxis,self.yaxis):
36033616
scale=ax.get_scale()
36043617
ifscale=='log':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp