-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: add layout='none' option to Figure constructor #25305
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
Conversation
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.
This is fine. Note that for pyplot it's not great to refer to the .Figure constructor for the meaning of the layout options.
I could copy the full description across to pyplot? |
I would, but it could be a different PR. |
531735e
to
e5631d3
Compare
lib/matplotlib/pyplot.py
Outdated
managers can measurably slow down figure display. Defaults to *None* | ||
(but see the documentation of the `.Figure` constructor regarding the | ||
interaction with rcParams). | ||
managers can measurably slow down figure display. Defaults to *None*. |
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.
Probably can remove the Default here as it's in the type line.
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.
Done.
lib/matplotlib/pyplot.py
Outdated
- 'constrained': The constrained layout solver adjusts axes sizes | ||
to avoid overlapping axes decorations. Can handle complex plot | ||
layouts and colorbars, and is thus recommended. | ||
|
||
See :doc:`/tutorials/intermediate/constrainedlayout_guide` | ||
for examples. | ||
|
||
- 'compressed': uses the same algorithm as 'constrained', but | ||
removes extra space between fixed-aspect-ratio Axes. Best for | ||
simple grids of axes. | ||
|
||
- 'tight': Use the tight layout mechanism. This is a relatively | ||
simple algorithm that adjusts the subplot parameters so that | ||
decorations do not overlap. See `.Figure.set_tight_layout` for | ||
further details. | ||
|
||
- 'none': Do not use a layout engine. | ||
|
||
- A `.LayoutEngine` instance. Builtin layout classes are | ||
`.ConstrainedLayoutEngine` and `.TightLayoutEngine`, more easily | ||
accessible by 'constrained' and 'tight'. Passing an instance | ||
allows third parties to provide their own layout engine. |
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.
There is an extra indent on all the continuation lines of each bullet point.
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.
oooops
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.
Fixed.
e5631d3
to
6b32e29
Compare
Looks like the formatting still needs some work? |
@@ -2420,11 +2420,11 @@ def __init__(self, | |||
The use of this parameter is discouraged. Please use | |||
``layout='constrained'`` instead. | |||
|
|||
layout : {'constrained', 'compressed', 'tight', `.LayoutEngine`, None} | |||
layout : {'constrained', 'compressed', 'tight', 'none', `.LayoutEngine`, \ | |||
None}, default: None |
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.
Its not your fault, but the 'constrained'
bullet below has an extra indent
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.
Oh that's why it's in bold. I was scratching my head about that...
…actions] [skip azp]
6b32e29
to
2d3cd47
Compare
I think it's OK now |
Agreed, thanks for cleaning up the previous breakage! |
…305-on-v3.7.x Backport PR #25305 on branch v3.7.x (DOC: add layout='none' option to Figure constructor)
PR Summary
Closes #25223. Documents the
layout='none'
option for creating a figure.PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst