【发布时间】:2013-05-30 12:06:26
【问题描述】:
我想更改 Python matplotlib 中所有图形命令的全局默认颜色栏。这类似于this question about changing the default colorbar in MATLAB。这里there is already a pythonic solution,但该解决方案需要制作一个情节才能使更改生效。有没有办法在第一个绘图之前设置默认值?
将以下内容放在~/.pythonrc 中似乎应该可以工作,但事实并非如此:
import matplotlib.pylab as plt
plt.rcParams['image.cmap'] = plt.cm.bwr
此外,我想将默认值设置为 colorbrewer2mpl 包中的某些内容,而不仅仅是预先存在的 matplotlib 选项。
【问题讨论】:
标签: python colors matplotlib default