Skip to content

Add simple explanation for plt.show() in getting started guide#31532

Closed
srinagadurga3455 wants to merge 4 commits intomatplotlib:mainfrom
srinagadurga3455:improve-getting-started-clarity
Closed

Add simple explanation for plt.show() in getting started guide#31532
srinagadurga3455 wants to merge 4 commits intomatplotlib:mainfrom
srinagadurga3455:improve-getting-started-clarity

Conversation

@srinagadurga3455
Copy link
Copy Markdown

PR summary

  • Added a simple explanation after plt.show() to clarify its behavior.
  • Helps beginners understand that this command opens a window displaying the plotted graph.

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

  • Added a one-line beginner-friendly explanation below the example plot code.

@github-actions github-actions bot added the Documentation: user guide files in galleries/users_explain or doc/users label Apr 19, 2026
Copy link
Copy Markdown
Member

@rcomer rcomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rcomer rcomer closed this Apr 19, 2026
@melissawm melissawm added the ai-contribution PRs that are AI generated without a human in the loop label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-contribution PRs that are AI generated without a human in the loop Documentation: user guide files in galleries/users_explain or doc/users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants