Add simple explanation for plt.show() in getting started guide#31532
Add simple explanation for plt.show() in getting started guide#31532srinagadurga3455 wants to merge 4 commits intomatplotlib:mainfrom
Conversation
rcomer
left a comment
There was a problem hiding this comment.
Thank you for your interest in improving the Matplotlib documentation. However, this is only supposed to be a very simple example and not go into explanation of what the various functions do at this point. That comes in the more comprehensive User Guide.
We are even considering removing this page completely as it does not do much #29775 (comment).
I see you also have commits from two other PRs here. When preparing a change, please branch from Matplotlib's main branch. I also suggest that, before creating a PR, you open an issue to discuss whatever points of confusion you are finding in the documentation. We can then come to an agreement about the best approach to resolve it.
| ax.plot(x, y) | ||
| plt.show() | ||
|
|
||
| This will open a window displaying the plotted graph. |
There was a problem hiding this comment.
This is not always true but depends on which backend you are using. For example, the inline and ipympl backends used in Jupyter notebooks show the plot within the page.
PR summary
plt.show()to clarify its behavior.Why this change?
The current example shows how to plot data but does not explicitly explain what
plt.show()does, which may be confusing for beginners.Changes made