Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 5 tasks
wenzao opened this issue Aug 25, 2016 · 4 comments
Closed
2 of 5 tasks

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

wenzao opened this issue Aug 25, 2016 · 4 comments

Comments

@wenzao
Copy link

wenzao commented Aug 25, 2016

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.
@jenshnielsen
Copy link
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.

@wenzao
Copy link
Author

wenzao commented Aug 26, 2016

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

@wenzao
Copy link
Author

wenzao commented Aug 26, 2016

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?

@tacaswell tacaswell added this to the unassigned milestone Aug 27, 2016
@tacaswell
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants