Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6070735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:58:01+00:00 2026-05-23T09:58:01+00:00

The documentation for the interactive mode in Matplotlib’s pyplot reads: The interactive property of

  • 0

The documentation for the “interactive mode” in Matplotlib’s pyplot reads:

The interactive property of the pyplot interface controls whether a figure canvas is drawn on every pyplot command. If interactive is False, then the figure state is updated on every plot command, but will only be drawn on explicit calls to draw(). When interactive is True, then every pyplot command triggers a draw.

This seems clear enough: when the interactive mode is on, one can do plot() without having to do draw(). However, doing draw() in the following code does not do anything:

from matplotlib import pyplot as pp

# Interactive mode is off by default

pp.plot([10, 20, 50])
pp.draw()

raw_input('Press enter...')  # No graph displayed?!!

(on Windows XP, Matplotlib 1.0.1).

Adding ion() at the beginning makes the figure(s) appear, while waiting for the user to type enter (which conveniently closes all the figures):

from matplotlib import pyplot as pp

ion()

pp.plot([10, 20, 50])  # No draw() is necessary

raw_input('Press enter...')  # The graph is interactive *and* the terminal responds to enter

Thus, it looks like ion() does more than just adding automatic graph updates after each plotting command, and I unfortunately can’t find anything in the documentation. Another, more important problem with the latter program is that ion() makes all plot commands update the graph, which is time consuming when a single graph is updated multiple times.

So, is there a way of:

  • having the terminal wait for enter, after which all the figures are automatically closed,
  • having interactive Matplotlib graphs,
  • … without forcing the interactive mode to be on at the beginning (so as to not force auto-updates of the graphs, which could be time consuming)?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:58:01+00:00Added an answer on May 23, 2026 at 9:58 am

    Here is the summary of an interesting discussion on this subject in the Matplotlib mailing list. The executive summary is:

    • The interactive mode (activated with ion()) automates many things. In particular, pyplot.* commands automatically update on the screen the relevant axes. However, method calls on Matplotlib objects like ax.plot() (ax being an Axes object) do not normally perform automatic updates; in this case, pyplot.draw() performs the necessary update.)

    • The non-interactive mode is less convenient. draw() does not normally update the figure on screen. The fact that draw() is somewhat “inactive” in non-interactive mode is not mentioned in the current documentation, but will hopefully be included there soon.

    In the mean time, more information on the interactive and non-interactive modes can be found in a current branch of Matplotlib. A better documentation for draw(), show() and friends can also be found in the same branch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm going through the matplotlib documentation and prepared to use the iPython interactive
I have been looking for documentation related to interacting with MSPaint from the command
Documentation is severely lacking on anything to do with stored procedures in mysql with
Documentation can be found here It says in the example: onDrop: Called whenever a
Documentation simply states that setting setAutosavingDelay to anything > 0 on the shared doc
The documentation for the round() function states that you pass it a number, and
The documentation with the module itself is pretty thin, and just tends to point
The documentation indicates that the error: option function will make available: XHR instance, a
The documentation available on the boost website is... limited. From what I've been able
The documentation for +[NSThread detachNewThreadSelector:toTarget:withObject:] says: For non garbage-collected applications, the method aSelector is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.