【发布时间】:2015-12-18 22:57:28
【问题描述】:
我正在关注Sane color scheme for Matplotlib,但发现我的着色是still the same 为the default color scheme。有什么问题?
我关注Customizing plots with style sheets,并在我的代码顶部使用这些:
import matplotlib.pyplot as plt
plt.style.use('ggplot')
是这个原因吗?或者是其他东西?
披露,
- 我已经对 huyng 的 gist 做了自己的修改,它创建于 2011 年 2 月 8 日。结果是here。
- 我自己修改的原因也列出了there。
- there 也解释了我放置文件的位置,之后我确实重新启动了 iphthon 笔记本。
- 我进行配色方案定制的原因是,引用自How to make beautiful data visualizations in Python with matplotlib, Color matters
matplotlib 中的默认配色方案非常难看。死忠的 matlab/matplotlib 粉丝可能会坚持他们的配色方案到最后,但不可否认的是,Tableau 的默认配色方案比 matplotlib 的要好几个数量级。
更新:表明我将有效的matplotlibrc 文件放置在正确的位置(已解释here):
D:\>python
Python 3.5.0 |Anaconda 2.4.0 (64-bit)| (default, Dec 1 2015, 11:46:22) [MSC v.1
900 64 bit (AMD64)] on win32
>>> import matplotlib
>>> matplotlib.matplotlib_fname()
'D:\\Programs\\Anaconda3\\lib\\site-packages\\matplotlib\\mpl-data\\matplotlibrc
'
D:\>dir D:\Programs\Anaconda3\libs\site-packages\matplotlib\mpl-data\matplotlibrc
Volume in drive D is New Volume
Directory of D:\Programs\Anaconda3\libs\site-packages\matplotlib\mpl-data
12/18/2015 05:34 PM 25,738 matplotlibrc
1 File(s) 25,738 bytes
【问题讨论】:
标签: python matplotlib customization color-scheme