-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Use explicit kwarg for plt.show() #11170
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
lib/matplotlib/pyplot.py
Outdated
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 you mean return _show(block=block)
here?
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 do think it's a good idea. Maybe one could even check for block
being a boolean. You won't believe how many people try to do things like plt.show(fig1)
, plt.show(ax)
etc. Showing a useful error in such cases may be helpful for them.
Apparently there is a problem with the web backend which doesn't take any arguments.
b8806d5
to
d4d80e5
Compare
d4d80e5
to
c10b2e0
Compare
d72aff3
to
c10b2e0
Compare
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 thought we fixed this already....
I am 👎 on changing the default value. If the user passed block=True
we should block unconditionally on any other state.
I am very 👍 on @ImportanceOfBeingErnest 's suggestion of giving a good warning in the common incorrect use of passing figures or axes to plt.show
(which does make sense in a guessing-the-API mode).
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.
👎 on changing the default.
If the user passes block=True
we need to block!
Is there currently a difference between block=None
and block=True
in terms of behaviour? I thought they were the same, but maybe not.
Concerning block=True
in the webbackend: #11201
Going to close this since I can't remember what's going on.
I feel like this might be a Bad Idea, but can't work out why - maybe others will be able to tell me if it is or not! Either way, the doc change is probably welcome.
Will add API notes if/when someone reviews.