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

Add alternatives to '%matplotlib inline' in numpy lesson #292

Open
jdidion opened this Issue Aug 3, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@jdidion

jdidion commented Aug 3, 2016

In newer versions of python, 'inline' appears not to be a valid backend. Two alternatives are:

  1. Start ipython with the '--pylab inline' option
  2. On OSX, use '%matplotlib osx' instead
@tbekolay

This comment has been minimized.

Contributor

tbekolay commented Aug 3, 2016

Can you point me to a resource that talks about the deprecation of %matplotlib inline? My understanding is the opposite, that %matplotlib inline is the correct choice moving forward, while --pylab inline is deprecated.

Perhaps this is an install issue? IPython is now part of the Jupyter ecosystem, so to install it you should be doing pip install jupyter or conda install jupyter rather than ipython.

@tbekolay

This comment has been minimized.

Contributor

tbekolay commented Aug 3, 2016

@jdidion

This comment has been minimized.

jdidion commented Aug 3, 2016

I am using anaconda and have installed jupyter via conda. When I do '%matplotlib inline' I get the following error:

No event loop integration for 'inline'. Supported event loops are: qt, qt4, qt5, gtk, gtk2, gtk3, tk, wx, pyglet, glut, osx

I assumed this was a python 2 vs 3 issue, but maybe it's a problem with my machine (or with osx in general)?

Have others run into this problem on their own or their students' computers?

@valentina-s

This comment has been minimized.

Contributor

valentina-s commented Aug 3, 2016

Are you running this command from a terminal or from a jupyter notebook. I get the same error from terminal, but not from inside a notebook.

@DealPete

This comment has been minimized.

DealPete commented Nov 7, 2018

I'm using osx, but typing %matplotlib osx in the IPython terminal generates an error for me.
%matplotlib inline does the same.
After playing around with this for awhile, it seems that what you want is just %matplotlib without the inline. If it works the same on other systems, lesson #1 should probably be update to reflect this.

@davidrpugh

This comment has been minimized.

davidrpugh commented Dec 6, 2018

Am going through the 2nd edition of Python for Data Analysis now and %matplotlib notebook is used which renders and interactive plot in the notebook. This seems superior to using %matplotlib inline which renders a static plot. According to the docs %matplotlib inline is still listed as the canonical way to enable plotting in the notebook.

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