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

Problems when switching matplotlib backends #7394

Open
YuccaTang opened this issue Jun 7, 2024 · 2 comments
Open

Problems when switching matplotlib backends #7394

YuccaTang opened this issue Jun 7, 2024 · 2 comments
Labels

Comments

@YuccaTang
Copy link

I was switching backends when using Jupyter notebook to save or display figures.

I first used matplotlib.use('inline') to display the figures, then I used matplotlib.use('agg') to save figures. It was ok even when I returned to recall matplotlib.use('inline') to show figures.

The problem is that when I first called matplotlib.use('agg') to save figures and then used matplotlib.use('inline'), the figures didn't show up. What I got was only something like <Figure size 640x480 with 1 Axes>.

By the way, if I used %matplotlib agg and %matplotlib inline instead of matplotlib.use('agg') and matplotlib.use('inline'), the switching of backends didn't cause any problems.

I attached a screenshot of demo codes for reproducing the problem.

Screenshot 2024-06-07 at 2 35 09 PM
@YuccaTang YuccaTang added bug status:Needs Triage Applied to issues that need triage labels Jun 7, 2024
@RRosio
Copy link
Collaborator

RRosio commented Jun 11, 2024

@yutang-1sec thank you for reporting this issue! Could you share which version of Notebook you are using?

A related issue from a few years ago is also open, #473, and as a workaround, a few users reported calling the line to set the backend multiple times sometimes allowed for it to take effect.
Similar issue also reported: https://stackoverflow.com/questions/41125690/matplotlib-notebook-showing-a-blank-histogram

@YuccaTang
Copy link
Author

@yutang-1sec thank you for reporting this issue! Could you share which version of Notebook you are using?

A related issue from a few years ago is also open, #473, and as a workaround, a few users reported calling the line to set the backend multiple times sometimes allowed for it to take effect. Similar issue also reported: https://stackoverflow.com/questions/41125690/matplotlib-notebook-showing-a-blank-histogram

@RRosio The version is 7.2.1. I think it is the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants