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

Skip to content

Small improvements to legend's docstring. #6618

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 1 commit into from
Sep 15, 2016
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
Small improvements to legend's docstring.
The source looks a bit weirder, but the output of `pydoc pylab.legend`
(or `plt.legend?` in IPython) is much nicer.  I don't think numpydoc
allows splitting the argument type information into two lines.
  • Loading branch information
anntzer committed Jun 21, 2016
commit 574c60ba223ab3fc3f952745c8ec80990b5fed27
8 changes: 4 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def legend(self, *args, **kwargs):
``bbox_to_anchor`` will be ignored).

bbox_to_anchor : :class:`matplotlib.transforms.BboxBase` instance \
or tuple of floats
or tuple of floats
Specify any arbitrary location for the legend in `bbox_transform`
coordinates (default Axes coordinates).

Expand All @@ -372,8 +372,8 @@ def legend(self, *args, **kwargs):
The font properties of the legend. If None (default), the current
:data:`matplotlib.rcParams` will be used.

fontsize : int or float or {'xx-small', 'x-small', 'small', 'medium',\
'large', 'x-large', 'xx-large'}
fontsize : int or float or {'xx-small', 'x-small', 'small', 'medium', \
Copy link
Member

Choose a reason for hiding this comment

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

This was before your patch, but why is there a backslash at the end of that line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That removes the newline from the string, and is necessary so that Sphinx interprets it correctly.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. Thanks for the explanation!

'large', 'x-large', 'xx-large'}
Controls the font size of the legend. If the value is numeric the
size will be the absolute font size in points. String values are
relative to the current default font size. This argument is only
Expand Down Expand Up @@ -403,7 +403,7 @@ def legend(self, *args, **kwargs):
drawn ones. Default is ``None`` which will take the value from
the ``legend.markerscale`` :data:`rcParam <matplotlib.rcParams>`.

*markerfirst*: [ *True* | *False* ]
markerfirst : bool
if *True*, legend marker is placed to the left of the legend label
if *False*, legend marker is placed to the right of the legend
label
Expand Down