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

Broken IPython notebook integration #2358

Merged
merged 1 commit into from Aug 30, 2013

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Aug 30, 2013

I recently updated my MPL version from 1.3 to master, and noticed IPython notebook integration is broken for me (Mac, Chrome). See the error message at http://nbviewer.ipython.org/6386054

I bisected this to 27482be

Is this a known issue? Is it still possible to use IPython's (static) inline backend after this commit?

@mdboom
Copy link
Member

mdboom commented Aug 30, 2013

It is still possible to use the regular static backend after this commit, as long as don't explicitly set it to WebAgg.

I can't reproduce this. I suspect that this probably has something to do with a version mismatch of either IPython or Tornado.

>>> import tornado
>>> tornado.version
'3.1'
>>> import IPython
>>> IPython.__version__
'0.13.2'

@ChrisBeaumont
Copy link
Contributor Author

It seems related to the IPython version: the following snippet

import matplotlib.pyplot as plt
plt.switch_backend('webAgg')
plt.plot([1,2,3], 'o')
plt.show()

works for me in both IPython 0.13.2 and 1.0.0

However, the new %matplotlib inline syntax introduced in IPython 1.0 is broken from 27482be onwards. From the traceback, it seems that MPL is trying to use the WebAgg backend, even though I never set the webAgg backend (see the gist)

@mdboom
Copy link
Member

mdboom commented Aug 30, 2013

I upgraded to IPython 1.0, and tried exactly what's in your gist, but still couldn't reproduce.

However (and this is puzzling, but at least it gets us somewhere), if I type:

plt.<TAB>pl<TAB>([1,2,3])

i.e., trigger autocomplete at some point while entering the content, I get the same traceback as in the gist.

@mdboom
Copy link
Member

mdboom commented Aug 30, 2013

Ok, I think I have a fix. Would you mind testing it?

@ChrisBeaumont
Copy link
Contributor Author

The gist now runs for me, and (correctly) uses IPython's inline backend.

mdboom added a commit that referenced this pull request Aug 30, 2013
Broken IPython notebook integration
@mdboom mdboom merged commit 84f0460 into matplotlib:master Aug 30, 2013
@mdboom mdboom deleted the fix-inline-figures branch August 7, 2014 13:54
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

Successfully merging this pull request may close these issues.

None yet

2 participants