我最近试图更新我的所有Anaconda包:
conda update conda
conda update anaconda
Run Code Online (Sandbox Code Playgroud)
其中一些还没有更新,所以我也做了conda update --all
.现在我的conda version : 4.3.16
,这似乎是最新版本.但是,出于某种原因,matplotlib仍然有旧版本:
conda list
matplotlib 1.5.1 np111py35_0
Run Code Online (Sandbox Code Playgroud)
根据Anaconda的更新日志,它应该更新到2.0版本:matplotlib from 1.5.3 to 2.0.0
.我安装的python版本3.5.2
,如果这很重要.
UPD:似乎spyder-app因为依赖问题而阻止更新:
conda install anaconda=4.3.1
UnsatisfiableError: The following specifications were found to be in conflict:
- anaconda 4.3.1* -> spyder 3.1.2 py34_0
- spyder-app -> spyder 2.3.3
Use "conda info <package>" to see the dependencies for each package.
conda install matplotlib=2
UnsatisfiableError: The following specifications …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用几个不同的库(bokeh
、seaborn
和matlotlib
)在 Python 中绘制绘图,但保持相同的配色方案。我从 bokeh with: 中选择了分类调色板,
from bokeh.palettes import Category10 as palette
然后也在seaborn
和中使用了它matplotlib
。我的问题是,虽然matplotlib
颜色看起来非常相似bokeh
(如调色板中定义的),但seaborn
显示出比应有的颜色明显更深的颜色(即饱和度较低或不饱和)。我想知道它是否默认对任何配色方案进行某种变暗,以及是否有任何方法可以避免这种情况。下面是使用不同库制作相同条形图的代码
使用bokeh
:
source = pd.DataFrame({'names': ['exp_1', 'exp_2'], 'data':[3, 5], 'color':palette[10][:2]})
p = bokeh.plotting.figure(x_range=['exp_1', 'exp_2'], y_range=(0,6), plot_height=500, title="test")
p.vbar(x='names', top='data', width=0.9, legend_field="names", source=source, color='color')
p.xgrid.grid_line_color = None
p.legend.orientation = "horizontal"
p.legend.location = "top_center"
p.xaxis.major_label_text_font_size = '22pt'
p.yaxis.major_label_text_font_size = '22pt'
bokeh.io.show(p)
Run Code Online (Sandbox Code Playgroud)
使用matplotlib
:
# same palette both for seaborn and matplotlib …
Run Code Online (Sandbox Code Playgroud)