Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make nbagg recognise the requested facecolor of a figure #5317

Closed
willfurnass opened this issue Oct 26, 2015 · 2 comments
Closed

Make nbagg recognise the requested facecolor of a figure #5317

willfurnass opened this issue Oct 26, 2015 · 2 comments

Comments

@willfurnass
Copy link

The nbagg backend in Matplotlib (1.4.3) seems to ignore calls to figure.set_facecolor.

I know that one can disable figure background transparency with nbagg.transparent : False in one's matplotlibrc (not a particularly well documented feature) but even with that set, the background is grey rather than any color requested with figure.set_facecolor.

@jenshnielsen
Copy link
Member

I cannot reproduce:

import matplotlib
import matplotlib.pyplot as plt
matplotlib.rcParams.update({'figure.facecolor': 'red',
                            'savefig.facecolor': 'yellow'})
plt.figure()
plt.plot([3, 2, 1])

with matplotlib.rc_context({'nbagg.transparent': False}):
    f= plt.figure()

plt.plot([3, 2, 1])
plt.show()

This taken from the nbagg UAT produces a red figure as expected with both 1.5rc and 1.4.3 can you please provide a minimal example of what you are doing?

@willfurnass
Copy link
Author

Apologies, I was calling set_facecolor with an invalid MPL color spec (fig.set_facecolor(1,1,1) rather than fig.set_facecolor((1,1,1)). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants