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
Switch correctly to the user's default matplotlib backend after inline. #4230
Conversation
If '%matplotlib inline' was called first, we'd incorrectly revert to inline when plain '%matplotlib' was called, instead of loading the user's default GUI. If the user called '%matplotlib' first (without 'inline') it worked correctly, but not in the other order. The fix is to read the backend from the original defaults, not from the runtime data structure.
Seems sensible enough - has rcParamsOrig been around long enough that we don't need a check on older matplotlibs (I just don't know). |
It's been there in mpl since 1.1.0, which was released in February 2012. Mpl 1.0 didn't have it. I'm inclined not to cruft up our code with too many protections for old third-party libraries in general. What do you think? I just hate layers and layers of |
We should probably think of a mechanism that warn/raise on IPython version bump to force us to clean things. Something along : with deprecate(warn=2.0, error=3.0):
# log.warn if IPython version > 2.0
# log.error (eventually die) if IPython > 3.0
(do stuff) Can do the same with decorator. This would also make our plan more visible for people tweeking the code. |
It seems pretty significant that this change means |
Yes, that is probably too aggressive. |
I'll add info about 1.1 being required (comment in block, a box in the docs). |
I think this one's good to go, as best I can tell. Let me know if you guys spot anything else. |
Switch correctly to the user's default matplotlib backend after inline. If '%matplotlib inline' was called first, we'd incorrectly revert to inline when plain '%matplotlib' was called, instead of loading the user's default GUI. If the user called '%matplotlib' first (without 'inline') it worked correctly, but not in the other order. The fix is to read the backend from the original defaults, not from the runtime data structure. Requires matplotlib 1.1
…backend after inline. If '%matplotlib inline' was called first, we'd incorrectly revert to inline when plain '%matplotlib' was called, instead of loading the user's default GUI. If the user called '%matplotlib' first (without 'inline') it worked correctly, but not in the other order. The fix is to read the backend from the original defaults, not from the runtime data structure.
Switch correctly to the user's default matplotlib backend after inline. If '%matplotlib inline' was called first, we'd incorrectly revert to inline when plain '%matplotlib' was called, instead of loading the user's default GUI. If the user called '%matplotlib' first (without 'inline') it worked correctly, but not in the other order. The fix is to read the backend from the original defaults, not from the runtime data structure. Requires matplotlib 1.1
If '%matplotlib inline' was called first, we'd incorrectly revert to
inline when plain '%matplotlib' was called, instead of loading the
user's default GUI. If the user called '%matplotlib' first (without
'inline') it worked correctly, but not in the other order.
The fix is to read the backend from the original defaults, not from
the runtime data structure.