In IPython Notebook 3, when I use the Inlinematplotlib backend , the png digits in the browser have a transparent background.
How do I set white instead?
Minimal example:
%matplotlib inline
import matplotlib.pyplot as plt
plt.plot([1,2])
Right-click and save the image, the image will have a transparent background, I would like it to be white.
Update
Tried to install figure.facecolorin matplotlibrc, but it still displays transparent png:
import matplotlib
print("facecolor before:")
print(matplotlib.rcParams["figure.facecolor"])
%matplotlib inline
import matplotlib.pyplot as plt
plt.plot([1,2])
print("facecolor after:")
print(matplotlib.rcParams["figure.facecolor"])
This code gives as output:
facecolor before:
1.0
facecolor after:
(1, 1, 1, 0)
source
share