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

Skip to content

Commit a7f16d2

Browse files
jklymakMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR matplotlib#10599: Axes doc updates
1 parent 33f7dbb commit a7f16d2

File tree

1 file changed

+40
-39
lines changed

1 file changed

+40
-39
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -560,16 +560,17 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
560560
"""
561561
Add text to the axes.
562562
563-
Add text in string `s` to axis at location `x`, `y`, data
564-
coordinates.
563+
Add the text *s* to the axes at location *x*, *y* in data coordinates.
565564
566565
Parameters
567566
----------
568567
x, y : scalars
569-
data coordinates
568+
The position to place the text. By default, this is in data
569+
coordinates. The coordinate system can be changed using the
570+
*transform* parameter.
570571
571-
s : string
572-
text
572+
s : str
573+
The text.
573574
574575
fontdict : dictionary, optional, default: None
575576
A dictionary to override the default text properties. If fontdict
@@ -579,6 +580,11 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
579580
Creates a `~matplotlib.text.TextWithDash` instance instead of a
580581
`~matplotlib.text.Text` instance.
581582
583+
Returns
584+
-------
585+
text : `.Text`
586+
The created `.Text` instance.
587+
582588
Other Parameters
583589
----------------
584590
**kwargs : `~matplotlib.text.Text` properties.
@@ -596,9 +602,8 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
596602
lower-left and 1,1 is upper-right). The example below places
597603
text in the center of the axes::
598604
599-
>>> text(0.5, 0.5,'matplotlib', horizontalalignment='center',
600-
... verticalalignment='center',
601-
... transform=ax.transAxes)
605+
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
606+
... verticalalignment='center', transform=ax.transAxes)
602607
603608
You can put a rectangular box around the text instance (e.g., to
604609
set a background color) by using the keyword `bbox`. `bbox` is
@@ -678,13 +683,8 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
678683
679684
See also
680685
--------
681-
hlines : add horizontal lines in data coordinates
682-
axhspan : add a horizontal span (rectangle) across the axis
683-
684-
Notes
685-
-----
686-
kwargs are passed to :class:`~matplotlib.lines.Line2D` and can be used
687-
to control the line properties.
686+
hlines : Add horizontal lines in data coordinates.
687+
axhspan : Add a horizontal span (rectangle) across the axis.
688688
689689
Examples
690690
--------
@@ -768,8 +768,8 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
768768
769769
See also
770770
--------
771-
vlines : add vertical lines in data coordinates
772-
axvspan : add a vertical span (rectangle) across the axis
771+
vlines : Add vertical lines in data coordinates.
772+
axvspan : Add a vertical span (rectangle) across the axis.
773773
"""
774774

775775
if "transform" in kwargs:
@@ -828,7 +828,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
828828
829829
See Also
830830
--------
831-
axvspan : add a vertical span across the axes
831+
axvspan : Add a vertical span across the axes.
832832
"""
833833
trans = self.get_yaxis_transform(which='grid')
834834

@@ -885,7 +885,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
885885
886886
See Also
887887
--------
888-
axhspan : add a horizontal span across the axes
888+
axhspan : Add a horizontal span across the axes.
889889
890890
Examples
891891
--------
@@ -3526,6 +3526,10 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
35263526
35273527
- ``means``: points or lines representing the means.
35283528
3529+
Notes
3530+
-----
3531+
.. [Notes section required for data comment. See #10189.]
3532+
35293533
"""
35303534

35313535
# If defined in matplotlibrc, apply the value from rc file
@@ -4783,41 +4787,38 @@ def arrow(self, x, y, dx, dy, **kwargs):
47834787
"""
47844788
Add an arrow to the axes.
47854789
4786-
Draws arrow on specified axis from (`x`, `y`) to (`x` + `dx`,
4787-
`y` + `dy`). Uses FancyArrow patch to construct the arrow.
4790+
This draws an arrow from ``(x, y)`` to ``(x+dx, y+dy)``.
47884791
47894792
Parameters
47904793
----------
4791-
x : float
4792-
X-coordinate of the arrow base
4793-
y : float
4794-
Y-coordinate of the arrow base
4795-
dx : float
4796-
Length of arrow along x-coordinate
4797-
dy : float
4798-
Length of arrow along y-coordinate
4794+
x, y : float
4795+
The x/y-coordinate of the arrow base.
4796+
dx, dy : float
4797+
The length of the arrow along x/y-direction.
47994798
48004799
Returns
48014800
-------
4802-
a : FancyArrow
4803-
patches.FancyArrow object
4801+
arrow : `.FancyArrow`
4802+
The created `.FancyArrow` object.
48044803
48054804
Other Parameters
4806-
-----------------
4807-
Optional kwargs (inherited from FancyArrow patch) control the arrow
4808-
construction and properties:
4805+
----------------
4806+
**kwargs
4807+
Optional kwargs (inherited from `.FancyArrow` patch) control the
4808+
arrow construction and properties:
48094809
48104810
%(FancyArrow)s
48114811
48124812
Notes
48134813
-----
48144814
The resulting arrow is affected by the axes aspect ratio and limits.
48154815
This may produce an arrow whose head is not square with its stem. To
4816-
create an arrow whose head is square with its stem, use
4817-
:meth:`annotate` for example::
4816+
create an arrow whose head is square with its stem,
4817+
use :meth:`annotate` for example:
4818+
4819+
>>> ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
4820+
... arrowprops=dict(arrowstyle="->"))
48184821
4819-
ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
4820-
arrowprops=dict(arrowstyle="->"))
48214822
"""
48224823
# Strip away units for the underlying patch since units
48234824
# do not make sense to most patch-like code
@@ -6183,7 +6184,7 @@ def table(self, **kwargs):
61836184
cellLoc='right', colWidths=None,
61846185
rowLabels=None, rowColours=None, rowLoc='left',
61856186
colLabels=None, colColours=None, colLoc='center',
6186-
loc='bottom', bbox=None):
6187+
loc='bottom', bbox=None)
61876188
61886189
Returns a :class:`matplotlib.table.Table` instance. Either `cellText`
61896190
or `cellColours` must be provided. For finer grained control over

0 commit comments

Comments
 (0)