Skip to content

Figure background is transparent when saving png from notebook backend. #8654

Closed
@efiring

Description

@efiring

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
screenshot_gray_background

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions