Skip to content

plot won't show with plt.show(block=False) #6979

Closed

Description

@wenzao

In IPython environment, When I make plot using plt.show(block=False), the plot won't show at all. And after the script is finished, if I press CTRL+D (to exit), then the plot will show up.

  • Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)
    Matplotlib 1.5.1, Python 3.5.2, IPython 5.1.0, Ubuntu
  • How did you install Matplotlib and Python (pip, anaconda, from source ...)
    Miniconda
  • If possible please supply a Short, Self Contained, Correct, Example
    that demonstrates the issue i.e a small piece of code which reproduces the issue
    and can be run with out any other (or as few as possible) external dependencies.
  • If this is an image generation bug attach a screenshot demonstrating the issue.
  • If this is a regression (Used to work in an earlier version of Matplotlib), please
    note where it used to work.
    It used to work well but I don't remember which version it was.

Activity

  1. jenshnielsen commented on Aug 26, 2016

    @jenshnielsen
    Member

    The best way to run maplotlib in IPython is via the enventloop integration activated with '%matplotlib' in which case you don't need show at all.

  2. wenzao commented on Aug 26, 2016

    @wenzao
    Author

    Could you elaborate? How do "activate %matplotlib"?

  3. wenzao commented on Aug 26, 2016

    @wenzao
    Author

    OK I think I activated it just by typing the command in the IPython terminal. But is there a way to include the activation into a python script?

  4. added this to the milestone on Aug 27, 2016
  5. tacaswell commented on Aug 27, 2016

    @tacaswell
    Member

    This will happen automatically when in the IPython shell going forward via #6734.

    That PR also shows you how to set up the event loop in a script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions