8000 DOC improved subplots' docstring by NelleV · Pull Request #7232 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

DOC improved subplots' docstring #7232

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 6 commits into from
Oct 13, 2016
Merged
Show file tree
Hide file tree
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
DOC merged sharex/y in subplots docstrings
  • Loading branch information
NelleV committed Oct 13, 2016
commit cf09849ae7637b9aaa4e6fbdbbeb729198a66bd3
40 changes: 15 additions & 25 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,31 +1028,21 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
nrows, ncols : int, default: 1
Number of rows/cols of the subplot grid.

sharex : {"none", "all", "row", "col"} or bool, default: False
- If True, the x-axis will be shared amongst all subplots.
- If False, no x-axis will be shared amongst subplots.
- If a string must be one of "row", "col", "all", or "none".
- "all" has the same effect as True.
- "none" has the same effect as False.
- If "row", each subplot row will share an x-axis.
- If "col", each subplot column will share an x-axis.

Note that if the x-axis is shared across rows (sharex=True or
sharex="col"), then the x tick labels will only be display on
subplots of the bottom row.

sharey : {"none", "all", "row", "col"} or bool, default: False
- If True, the y-axis will be shared amongst all subplots.
- If False, no y-axis will be shared amongst subplots.
- 8000 If a string must be one of "row", "col", "all", or "none".
- "all" has the same effect as True.
- "none" has the same effect as False.
- If "row", each subplot row will share a y-axis.
- If "col", each subplot column will share an y-axis

Note that if the y-axis is shared across columns (sharey=True or
sharey="col"), then the y tick labels will only be displayed on
subplots of the first column.
sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
Controls sharing of properties among x (`sharex`) or y (`sharey`)
axes:

- True or 'all': x- or y-axis will be shared among all
Copy link
Member

Choose a reason for hiding this comment

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

I think you need a blank line here because sphinx

Copy link
Member Author

Choose a reason for hiding this comment

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

yep… I fixed that (but haven't tested) and took this opportunity to rebase.

subplots.
- False or 'none': each subplot x- or y-axis will be
independent.
- 'row': each subplot row will share an x- or y-axis.
- 'col': each subplot column will share an x- or y-axis.
< 8000 /td>
When subplots have a shared x-axis along a column, only the x tick
labels of the bottom subplot are visible. Similarly, when
subplots have a shared y-axis along a row, only the y tick labels
of the first column subplot are visible.

squeeze : bool, default: True
- If True, extra dimensions are squeezed out from the returned
Expand Down
40 changes: 15 additions & 25 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,31 +1050,21 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
nrows, ncols : int, optional, default: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

The 'optional' is a bit weird as it is not precised for the other kwargs of subplots, neither in pyplot.py nor in figure.py.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is, just not for sharex and sharey, and the only reason is that I can't be bothered to fix the fact that the line is then too long…
I'll let someone else fix that.

Number of rows/columns of the subplot grid.

sharex : {"none", "all", "row", "col"} or bool, default: False
- If True, the x-axis will be shared amongst all subplots.
- If False, no x-axis will be shared amongst subplots.
- If a string must be one of "row", "col", "all", or "none".
- "all" has the same effect as True.
- "none" has the same effect as False.
- If "row", each subplot row will share an x-axis.
- If "col", each subplot column will share an x-axis.

Note that if the x-axis is shared across rows (sharex=True or
sharex="col"), then the x tick labels will only be display on subplots
of the bottom row.

sharey : {"none", "all", "row", "col"} or bool, default: False
- If True, the y-axis will be shared amongst all subplots.
- If False, no y-axis will be shared amongst subplots.
- If a string must be one of "row", "col", "all", or "none".
- "all" has the same effect as True.
- "none" has the same effect as False.
- If "row", each subplot row will share a y-axis.
- If "col", each subplot column will share an y-axis

Note that if the y-axis is shared across columns (sharey=True or
sharey="col"), then the y tick labels will only be displayed on
subplots of the first column.
sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
Controls sharing of properties among x (`sharex`) or y (`sharey`)
axes:

- True or 'all': x- or y-axis will be shared among all
subplots.
- False or 'none': each subplot x- or y-axis will be
independent.
- 'row': each subplot row will share an x- or y-axis.
- 'col': each subplot column will share an x- or y-axis.

When subplots have a shared x-axis along a column, only the x tick
labels of the bottom subplot are visible. Similarly, when subplots
have a shared y-axis along a row, only the y tick labels of the first
column subplot are visible.

squeeze : bool, optional, default: True
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 think there is an indentation problem around here, but I can't see it.

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 found the problem and fixed it.

- If True, extra dimensions are squeezed out from the returned Axes
Expand Down
0