-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Axes doc updates #10599
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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. | ||
|
@@ -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 | ||
|
@@ -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 | ||
-------- | ||
|
@@ -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: | ||
|
@@ -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') | ||
|
||
|
@@ -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 | ||
-------- | ||
|
@@ -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.] | ||
|
||
""" | ||
|
||
# If defined in matplotlibrc, apply the value from rc file | ||
|
@@ -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`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One of these changes is causing:
|
||
`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 | ||
|
@@ -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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.