Skip to content

DOC: changed documentation for axvspan to numpydoc format #7267

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 2 commits into from
Oct 15, 2016
Merged
Changes from 1 commit
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
Prev Previous commit
FIX pep8 compliance
  • Loading branch information
NelleV committed Oct 13, 2016
commit 0bc77dc04e6faf496810aa10bbb9c62c41b51dc9
6 changes: 3 additions & 3 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
ymax : scalar, optional
Number indicating the second Y-axis coordinate of the vertical
span rectangle in relative Y-axis units (0-1). Default to 1.

Returns
-------
rectangle : matplotlib.patches.Polygon
Expand All @@ -898,10 +898,10 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
See Also
--------
axhspan

Examples
--------
Draw a vertical, green, translucent rectangle from x = 1.25 to
Draw a vertical, green, translucent rectangle from x = 1.25 to
x = 1.55 that spans the yrange of the axes.

>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
Copy link
Member

Choose a reason for hiding this comment

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

What's the consensus on the style and "completeness" of examples like this?

My thought is that something like:

import matplotlib.pyplot as plt
fig, ax  = plt.subplots()
ax.axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
plt.show()

or a link to the gallery/examples would be better.

I don't feel very strongly about that, though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that a full runnable example would be much better. I am not a big fan of links in the gallery as they are only good for sphinx rendered documentation, but do not render properly in terminal docstring.

Expand Down