matplotlib / matplotlib/matplotlib

[Doc]: difference between pyplot.draw and fig.canvas.draw_idle

Open
#24,578 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation keep topic: backends
Dominant language
Python
Stars
23.2k
Forks
8.5k
Avg merge
1d 6h
Merged PRs (30d)
66

Description

### Documentation Link

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.draw.html

### Problem

> This is equivalent to calling `fig.canvas.draw_idle()`, where `fig` is the current figure.

To me, `draw` sounds a synchronous behavior, whereas `draw_idle` sounds like an asynchronous behavior. I think this statement of equivalence is confusing, because it claims what sounds to me like two different behaviors, are actually the same.

Can we elaborate on the equivalence, perhaps making it more clear what `draw_idle` means?

Also, on that page, can we link to the docs for `draw_idle` (if there are docs on it)?

### Suggested improvement

I am not familiar with `matplotlib` enough to make a quality suggestion here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pyplot.draw documentation at the linked page, then locate and read the documentation for fig.canvas.draw_idle to understand the claimed equivalence. Clarify the synchronous or deferred behavior in the draw description and add a link to draw_idle; the documentation should explain the distinction without ambiguity.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.