Fix use of --pylab=auto and --matplotlib=auto #14403
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #14401 which has been a bug in the 8.22.x and 8.23.x releases.
When I removed the multiple initialisation of Matplotlib backends in #14330 it broke use of the following:
by failing to display Matplotlib plot. If you specify a particular GUI event loop such as using
then it was and is fine. So for anyone finding this, the workaround until the next release is to specify a GUI loop rather than relying on the auto selection.
I didn't notice this as I've been concentrating on moving the Matplotlib backend logic from IPython to Matplotlib, and with those changes (matplotlib/matplotlib#27948) the above use cases all work OK.
The fix is to reintroduce the early import of
matplotlib-inline
but only if both the gui loop is not specified and the Matplotlib version is before the movement of the backend logic across to it.There are no explicit tests for this. In the future I will try to think of some tests for some of this IPython-Matplotlib functionality that don't involve installing complicated backend dependencies or adding image comparison tests.