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
Figure background is transparent when saving png from notebook backend. #8654
I used a screenshot below instead of the file 'test.png' because the odd background only shows up in preview, which evidently uses a light gray background instead of the usual white. Actual outcome
Expected outcome
I expect the white figure background that results in the above example when saving a pdf, or when using a different backend.
Matplotlib version
Operating System: OS X 10.12.4
Matplotlib Version: 2.0.2+7.ge6295a4a7
Python Version: 3.5.2
Jupyter Version (if applicable): 4.2.1
Reacted by David Ignacio Cortes, Caylin, Dhairya Vyas, Jake Westfall and Anton Mosin
On Mon, May 22, 2017 at 9:34 PM, Eric Firing ***@***.***> wrote:
Bug report
In Jupyter notebook with %matplotlib notebook:
*Code for reproduction*
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([1,2])
fig.savefig('test.png')
I used a screenshot below instead of the file 'test.png' because the odd
background only shows up in preview, which evidently uses a light gray
background instead of the usual white.
*Actual outcome*
[image: screenshot_gray_background]
<https://cloud.githubusercontent.com/assets/85125/26334867/aeff9662-3f03-11e7-9030-b543c700522a.png>
*Expected outcome*
I expect the white figure background that results in the above example
when saving a pdf, or when using a different backend.
*Matplotlib version*
- Operating System: OS X 10.12.4
- Matplotlib Version: 2.0.2+7.ge6295a4a7
- Python Version: 3.5.2
- Jupyter Version (if applicable): 4.2.1
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8654>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-HfrTl5urWrqnHZLVVSm1Oi22Tetks5r8jengaJpZM4NjEyq>
.
TBH I don't see why this was even introduced (well, perhaps @pelson can comment on that :-)), although this may be related to defaulting to a white background in 2.0. Unless there's a compelling reason to keep it I would suggest deprecating this (figure.facecolor should be more than enough, especially now that you can set it using a RRGGBBAA string).
This was hard to debug... There is already a figure.facecolor which should be controlling the figure's colour. What's this additional parameter?
Now behaviour of inline and notebook are not consistent (meaning, I spent an hour trying to figure out why my scripts are not working interchangeably).
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
WeatherGod commentedon May 23, 2017
anntzer commentedon Aug 31, 2017
Nah, this is controlled by the nbagg.transparent rcparam which has defaulted to true, well, probably ever since nbagg existed (https://github.com/matplotlib/matplotlib/pull/3560/files).
TBH I don't see why this was even introduced (well, perhaps @pelson can comment on that :-)), although this may be related to defaulting to a white background in 2.0. Unless there's a compelling reason to keep it I would suggest deprecating this (figure.facecolor should be more than enough, especially now that you can set it using a RRGGBBAA string).
Atcold commentedon Oct 18, 2017
This was hard to debug... There is already a
figure.facecolorwhich should be controlling the figure's colour. What's this additional parameter?Now behaviour of
inlineandnotebookare not consistent (meaning, I spent an hour trying to figure out why my scripts are not working interchangeably).anntzer commentedon Oct 18, 2017
Feel free to put up a PR deprecating the rcparam (I would support doing so).
github-actions commentedon Apr 12, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
QuLogic commentedon Apr 12, 2023
This was deprecated in #10024 and removed in #12763.