You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rationale for plt.show() that Alex Briceño gave, that it prevents the Matplotlib object repr from being shown, is not a strong reason. The same would be accomplished by replacing "plt.show()" with "None". What's happening is that Jupyter is showing the repr of the last Python object returned by the last line in the cell. (plt.show() returns None.)
A better argument could be made that plt.show() is necessary when you're not in Jupyter, but then the workflow is entirely different: if it's in a single threaded Python commandline, you don't get access to do anything in Python until you close the window that plt.show() pops up. So that's not a very friendly way of working, anyway. But anyway, including the plt.show() is indicating where it would be needed if you weren't using Jupyter, in case somebody needs to know that.
This issue or pull request has been automatically marked as stale because it has not had recent activity. Please manually close it, if it is no longer relevant, or ask for help or support to help getting it unstuck. Let me bring this to the attention of @klieret@wdconinc@michmx for now.
Was also a question at pyhep: Is
plt.show()
really necessary?I think we should explain what it does and also
%matplotlib inline
.Might also talk about how return values are shown (sometimes leading to plots being shown double, which is why people then add
;
...)The text was updated successfully, but these errors were encountered: