我正在尝试让我的 jupyter/python/%matplotlib 图表在深色背景下工作。我想为整个图像设置白色背景色,而不是默认的透明背景色。
%matplotlib notebook
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
fig.savefig('dummy.png', facecolor='w', transparent=False)
标准响应是使用 Facecolor,但这并不能解决问题 here .
最佳答案
savefig
在 rcParams 中有单独的条目:
plt.rcParams['savefig.facecolor'] = '黑色'
关于python - matplotlib 内联facecolor 不适用于savefig,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47226172/