-
-
Notifications
You must be signed in to change notification settings - Fork 8k
DOC added kwargs and tight_layout description in plt.figure #16247
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
@@ -450,6 +450,16 @@ def figure(num=None, # autoincrement if None, else integer from 1-N | |||
clear : bool, default: False | |||
If True and the figure already exists, then it is cleared. | |||
|
|||
tight_layout : bool or dict, default: :rc:`figure.autolayout` |
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 guess this doesn't need to be listed explicitly here? It's a normal Figure kwarg anyways, so documented there; if anything we may rather want to promote the use of constrained_layout?
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.
Sure, nothing really has to be listed explicitly here. All the arguments here but one are indeed duplicates of figure.Figure.
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 am fine with tight_layout
here, but should also add constrained_layout
(can be a diff PR). The sphinx link below needs to be fixed (leading dot?, I really find sphinx documentation to be hard to make valid cross-references for).
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.
re: sphinx references: any reference to something not in the current module needs to be prefixed by a dot. Possibly with the module name in front to disambiguate further (e.g. between .Axes.plot
and .pyplot.plot
, otherwise sphinx reasonably complains that it doesn't know which one to use), but not necessary if there is no ambiguity (e.g. .Figure
). What gets printed in the rendered html is what you put between the backquotes, minus the leading dot, unless you add a tilde in front of it, in which case all the context is stripped so e.g. ~.Axes.plot
and ~.pyplot.plot
both get rendered as plot
.
(This is made slightly more complicated by the fact that often we have docstrings that are originally defined in one module but end up also in an object defined in another module (via inheritance); sphinx is not able to follow that and will complain if the inherited docstring "wanted" to refer to objects in the first module without using a leading dot.)
Also anything referring to something not in matplotlib at all (i.e. numpy, etc.) needs to be fully qualified.
Feel free to close if you feel this shouldn't go in. |
30b8645
to
a3b8a32
Compare
a3b8a32
to
cc7e3a4
Compare
Sorry, I'd missed that the was fixed.... |
Added tight_layout and kwargs argument description to plt.figure.