@@ -561,16 +561,17 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
561
561
"""
562
562
Add text to the axes.
563
563
564
- Add text in string `s` to axis at location `x`, `y`, data
565
- coordinates.
564
+ Add the text *s* to the axes at location *x*, *y* in data coordinates.
566
565
567
566
Parameters
568
567
----------
569
568
x, y : scalars
570
- data coordinates
569
+ The position to place the text. By default, this is in data
570
+ coordinates. The coordinate system can be changed using the
571
+ *transform* parameter.
571
572
572
- s : string
573
- text
573
+ s : str
574
+ The text.
574
575
575
576
fontdict : dictionary, optional, default: None
576
577
A dictionary to override the default text properties. If fontdict
@@ -580,6 +581,11 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
580
581
Creates a `~matplotlib.text.TextWithDash` instance instead of a
581
582
`~matplotlib.text.Text` instance.
582
583
584
+ Returns
585
+ -------
586
+ text : `.Text`
587
+ The created `.Text` instance.
588
+
583
589
Other Parameters
584
590
----------------
585
591
**kwargs : `~matplotlib.text.Text` properties.
@@ -597,9 +603,8 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
597
603
lower-left and 1,1 is upper-right). The example below places
598
604
text in the center of the axes::
599
605
600
- >>> text(0.5, 0.5,'matplotlib', horizontalalignment='center',
601
- ... verticalalignment='center',
602
- ... transform=ax.transAxes)
606
+ >>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
607
+ ... verticalalignment='center', transform=ax.transAxes)
603
608
604
609
You can put a rectangular box around the text instance (e.g., to
605
610
set a background color) by using the keyword `bbox`. `bbox` is
@@ -4781,41 +4786,38 @@ def arrow(self, x, y, dx, dy, **kwargs):
4781
4786
"""
4782
4787
Add an arrow to the axes.
4783
4788
4784
- Draws arrow on specified axis from (`x`, `y`) to (`x` + `dx`,
4785
- `y` + `dy`). Uses FancyArrow patch to construct the arrow.
4789
+ This draws an arrow from ``(x, y)`` to ``(x+dx, y+dy)``.
4786
4790
4787
4791
Parameters
4788
4792
----------
4789
- x : float
4790
- X-coordinate of the arrow base
4791
- y : float
4792
- Y-coordinate of the arrow base
4793
- dx : float
4794
- Length of arrow along x-coordinate
4795
- dy : float
4796
- Length of arrow along y-coordinate
4793
+ x, y : float
4794
+ The x/y-coordinate of the arrow base.
4795
+ dx, dy : float
4796
+ The length of the arrow along x/y-direction.
4797
4797
4798
4798
Returns
4799
4799
-------
4800
- a : FancyArrow
4801
- patches .FancyArrow object
4800
+ arrow : `. FancyArrow`
4801
+ The created ` .FancyArrow` object.
4802
4802
4803
4803
Other Parameters
4804
- -----------------
4805
- Optional kwargs (inherited from FancyArrow patch) control the arrow
4806
- construction and properties:
4804
+ ----------------
4805
+ **kwargs
4806
+ Optional kwargs (inherited from `.FancyArrow` patch) control the
4807
+ arrow construction and properties:
4807
4808
4808
4809
%(FancyArrow)s
4809
4810
4810
4811
Notes
4811
4812
-----
4812
4813
The resulting arrow is affected by the axes aspect ratio and limits.
4813
4814
This may produce an arrow whose head is not square with its stem. To
4814
- create an arrow whose head is square with its stem, use
4815
- :meth:`annotate` for example::
4815
+ create an arrow whose head is square with its stem,
4816
+ use :meth:`annotate` for example:
4817
+
4818
+ >>> ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
4819
+ ... arrowprops=dict(arrowstyle="->"))
4816
4820
4817
- ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
4818
- arrowprops=dict(arrowstyle="->"))
4819
4821
"""
4820
4822
# Strip away units for the underlying patch since units
4821
4823
# do not make sense to most patch-like code
@@ -6181,7 +6183,7 @@ def table(self, **kwargs):
6181
6183
cellLoc='right', colWidths=None,
6182
6184
rowLabels=None, rowColours=None, rowLoc='left',
6183
6185
colLabels=None, colColours=None, colLoc='center',
6184
- loc='bottom', bbox=None):
6186
+ loc='bottom', bbox=None)
6185
6187
6186
6188
Returns a :class:`matplotlib.table.Table` instance. Either `cellText`
6187
6189
or `cellColours` must be provided. For finer grained control over
0 commit comments