-
-
Notifications
You must be signed in to change notification settings - Fork 397
Make inline the default matplotlib backend #159
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
Conversation
uses MPLBACKEND env (matplotlib > 1.5). Trigger extra IPython inline setup when inline backend is loaded. We can't call the simpler `ip.enable_matplotlib()` here because this will be triggered during pyplot import, and enable_matplotlib() imports pyplot which isn't ready yet.
|
This gets a +1 from me, at least. |
|
Looks good, but before merging, there should be a quick note in the docs about
But I love the improvement! |
|
The MPLBACKEND isn't being created for ipython. It already existed and is On Wed, Jul 13, 2016 at 11:41 PM, Fernando Perez [email protected]
|
|
Got it. At the very least our docs should mention that with a link to the relevant MPL docs... Users may enter only via our docs, so we want to let them know how we honor this, even if the full details are elsewhere. It's also so it goes into our release notes next time... |
|
True... there is On Wed, Jul 13, 2016 at 11:56 PM, Fernando Perez [email protected]
|
|
Awesome, nice find! |
|
@minrk Do you want to add a whatsnew entry, then I think we can merge this. |
|
This should probably be configurable so ipympl can over ride this? |
|
@tacaswell it is configurable, via the MPLBACKEND environment variable. This only sets that if it's not already set. Do you think there should be another setting somewhere? |
|
Sorry for the delay, I'm still catching up on email backlog from SciPy. Added note to changelog about it, linking to MPLBACKEND docs. @fperez I don't think our recommendations should change.
The only thing this has higher priority than is |
|
Sorry, I was a bit confused. The ENV only has an effect if it is set before matplotlib is imported for the first time. I am not super familiar with the kernel codebase, but it looks like is always true here. What As a side note, we are very slowly starting push the pyplot related state all the way into |
|
I think this is ready to go, and then we can release 4.4. Anything else to do/discuss here? |
|
Looks good to me |
uses recently discovered (c/o @WeatherGod) MPLBACKEND env (matplotlib > 1.5) to make inline the 'default' backend, for users who don't call
matplotlib.use()or%matplotlibprior to plotting.Trigger extra IPython inline setup when inline backend is loaded. We can't call the simpler
ip.enable_matplotlib()here because this will be triggered during pyplot import, and enable_matplotlib() imports pyplot which isn't ready yet.This PR is a sibling of matplotlib/matplotlib#6734
With both PRs, users importing matplotlib and using it without calling
%matplotlib <anything>should get reasonable behavior in all of:Either PR independently solves the hang in notebooks, but together they should do what we have been wanting for a long time.
This should remove the need for us to do anything with an import hook (#82).
SciPy hallway discussions FTW!
cc @tacaswell @mdboom @takluyver @fperez