You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Saved figure backgrounds are always transparent #234
I'm not positive that this is ipympl and not matplotlib, but when I click the button to save the plot, the image always has a transparent background. Using fig.patch.set_facecolor('#111111') doesn't seem to help.
Yes - there is some version thing going on! I just tried with 3.2.1, and I got your backgrounds using your code. But using the save button next to the plot (which is what I was doing above) gives me a blue saved figure. So the button does something different from savefig. In the older matplotlib, both methods yield a transparent background.
So it appears that this is a limitation of older matplotlib, and also the button in the widget behaves differently from savefig.
oooh I see, I somehow missed that you using the button to save the plot. Indeed if use matplolibt from the terminal and try the save button it saves with a red background:
I think that the underlying issue here is the same as #138
Activity
ianhi commentedon Jul 16, 2020
I think this is the correct behavior, in the rcparams there is a separate setting for the facecolor of savefig. See https://stackoverflow.com/a/4805178/835607
Can you try it with:
slopedog commentedon Jul 24, 2020
That didn't seem to do the trick.

ianhi commentedon Jul 24, 2020
Maybe this is a matplotlib issue? I am using matplotlib version 3.2.1 and get this:

ianhi commentedon Jul 24, 2020
another check to isolate the cause is to try this with
%matplotlib inlineto see if this is due to ipympl or something elseslopedog commentedon Jul 24, 2020
Yes - there is some version thing going on! I just tried with 3.2.1, and I got your backgrounds using your code. But using the save button next to the plot (which is what I was doing above) gives me a blue saved figure. So the button does something different from
savefig. In the older matplotlib, both methods yield a transparent background.So it appears that this is a limitation of older matplotlib, and also the button in the widget behaves differently from
savefig.ianhi commentedon Jul 24, 2020
oooh I see, I somehow missed that you using the button to save the plot. Indeed if use matplolibt from the terminal and try the save button it saves with a red background:

I think that the underlying issue here is the same as #138
slopedog commentedon Jul 24, 2020
Great - thanks for tracking this down!
Feature: Respect savefig rcParams in Download button
Test: Add comprehensive test notebook for rcParams support
Feature: Respect savefig rcParams in Download button
Test: Add comprehensive tests for rcParams support
Feature: Respect savefig rcParams in Download button
Test: Add comprehensive tests for rcParams support
Feature: Respect savefig rcParams in Download button
Test: Add comprehensive tests for rcParams support
Feature: Respect savefig rcParams in Download button
Test: Add comprehensive tests for rcParams support
FIX: Toolbar savefig respects rcparams (#615)
ianhi commentedon Jan 21, 2026
this should now work in the just released on pypi (soon on conda-forge) version 0.10.0