8000 Make background transparent by default when saving figure · Issue #2384 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Make background transparent by default when saving figure #2384
Closed
@nschloe

Description

@nschloe

When saving a matplotlib figure as PNG or SVG, the background is always saved as white canvas. This is somewhat confusing since the background color of a figure as displayed by matplotlib's interactive backend is gray.
Also, the white background makes the figure look foreign when embedded in something that does not have a white background.

I would suggest to change the default either to save the background

  • in the color that is actually displayed, or
  • as transparent.

Note that the letter is possible by explicitly setting

fig = pp.figure()                                                           
fig.patch.set_alpha(0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0