Skip to content

figure background color not respected by savefig() #17321

Closed
@nschloe

Description

@nschloe

The figure background color is not respected by savefig(). MWE:

import matplotlib.pyplot as plt

fig = plt.figure()
plt.plot([1, 2, 3], [1, 2, 3])

plt.gca().set_facecolor('#2d2d2d')
plt.gcf().patch.set_facecolor('#2d2d2d')

# plt.show()
plt.savefig("out.png")

show():
out1

savefig():
out

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions