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

Skip to content

Axes doc updates #10599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 40 additions & 39 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,16 +561,17 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
"""
Add text to the axes.

Add text in string `s` to axis at location `x`, `y`, data
coordinates.
Add the text *s* to the axes at location *x*, *y* in data coordinates.

Parameters
----------
x, y : scalars
data coordinates
The position to place the text. By default, this is in data
coordinates. The coordinate system can be changed using the
*transform* parameter.

s : string
text
s : str
The text.

fontdict : dictionary, optional, default: None
A dictionary to override the default text properties. If fontdict
Expand All @@ -580,6 +581,11 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
Creates a `~matplotlib.text.TextWithDash` instance instead of a
`~matplotlib.text.Text` instance.

Returns
-------
text : `.Text`
The created `.Text` instance.

Other Parameters
----------------
**kwargs : `~matplotlib.text.Text` properties.
Expand All @@ -597,9 +603,8 @@ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
lower-left and 1,1 is upper-right). The example below places
text in the center of the axes::

>>> text(0.5, 0.5,'matplotlib', horizontalalignment='center',
... verticalalignment='center',
... transform=ax.transAxes)
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
... verticalalignment='center', transform=ax.transAxes)

You can put a rectangular box around the text instance (e.g., to
set a background color) by using the keyword `bbox`. `bbox` is
Expand Down Expand Up @@ -679,13 +684,8 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):

See also
--------
hlines : add horizontal lines in data coordinates
axhspan : add a horizontal span (rectangle) across the axis

Notes
-----
kwargs are passed to :class:`~matplotlib.lines.Line2D` and can be used
to control the line properties.
hlines : Add horizontal lines in data coordinates.
axhspan : Add a horizontal span (rectangle) across the axis.

Examples
--------
Expand Down Expand Up @@ -769,8 +769,8 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):

See also
--------
vlines : add vertical lines in data coordinates
axvspan : add a vertical span (rectangle) across the axis
vlines : Add vertical lines in data coordinates.
axvspan : Add a vertical span (rectangle) across the axis.
"""

if "transform" in kwargs:
Expand Down Expand Up @@ -829,7 +829,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):

See Also
--------
axvspan : add a vertical span across the axes
axvspan : Add a vertical span across the axes.
"""
trans = self.get_yaxis_transform(which='grid')

Expand Down Expand Up @@ -886,7 +886,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):

See Also
--------
axhspan : add a horizontal span across the axes
axhspan : Add a horizontal span across the axes.

Examples
--------
Expand Down Expand Up @@ -3525,6 +3525,10 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,

- ``means``: points or lines representing the means.

Notes
-----
.. [Notes section required for data comment. See #10189.]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is the source of the problem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was an indented %(FancyArrow)s. For now, I've unindented it again, which messes up the Other Parameters section, but at least builds. Might be fixed with #10364.


"""

# If defined in matplotlibrc, apply the value from rc file
Expand Down Expand Up @@ -4782,41 +4786,38 @@ def arrow(self, x, y, dx, dy, **kwargs):
"""
Add an arrow to the axes.

Draws arrow on specified axis from (`x`, `y`) to (`x` + `dx`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of these changes is causing:

Warning, treated as error:
/home/circleci/project/lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes.Axes.arrow:31:Block quote ends without a blank line; unexpected unindent.
Makefile:20: recipe for target 'html' failed

`y` + `dy`). Uses FancyArrow patch to construct the arrow.
This draws an arrow from ``(x, y)`` to ``(x+dx, y+dy)``.

Parameters
----------
x : float
X-coordinate of the arrow base
y : float
Y-coordinate of the arrow base
dx : float
Length of arrow along x-coordinate
dy : float
Length of arrow along y-coordinate
x, y : float
The x/y-coordinate of the arrow base.
dx, dy : float
The length of the arrow along x/y-direction.

Returns
-------
a : FancyArrow
patches.FancyArrow object
arrow : `.FancyArrow`
The created `.FancyArrow` object.

Other Parameters
-----------------
Optional kwargs (inherited from FancyArrow patch) control the arrow
construction and properties:
----------------
**kwargs
Optional kwargs (inherited from `.FancyArrow` patch) control the
arrow construction and properties:

%(FancyArrow)s

Notes
-----
The resulting arrow is affected by the axes aspect ratio and limits.
This may produce an arrow whose head is not square with its stem. To
create an arrow whose head is square with its stem, use
:meth:`annotate` for example::
create an arrow whose head is square with its stem,
use :meth:`annotate` for example:

>>> ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
... arrowprops=dict(arrowstyle="->"))

ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
arrowprops=dict(arrowstyle="->"))
"""
# Strip away units for the underlying patch since units
# do not make sense to most patch-like code
Expand Down Expand Up @@ -6182,7 +6183,7 @@ def table(self, **kwargs):
cellLoc='right', colWidths=None,
rowLabels=None, rowColours=None, rowLoc='left',
colLabels=None, colColours=None, colLoc='center',
loc='bottom', bbox=None):
loc='bottom', bbox=None)

Returns a :class:`matplotlib.table.Table` instance. Either `cellText`
or `cellColours` must be provided. For finer grained control over
Expand Down