在seaborn中使用调色板Vega10时的ValueError

时间:2017-04-08 02:50:19

标签: python seaborn

您好我的笔记本电脑上安装了Anaconda。在其中,matplotlib版本为1.5.1,seaborn版本为0.7.1。在我的jupyter笔记本中,我试图使用seaborn来执行countplot。但是当我在palette = Vega10中使用seaborn.countplot时,我收到以下错误,

ValueError: Vega10 is not a valid palette name

但是,如果我们使用matplotlib colormap链接,我们会发现他们已将Vega10列为众多彩色地图之一。

3 个答案:

答案 0 :(得分:0)

根据评论,' Vega10' colormap是在matplotlib 2.0中添加的,更新到该版本可以解决问题。

答案 1 :(得分:0)

Vega已弃用,现在是tab,只需将代码更改为a,而不是将Vega10更改为tab10等。

https://matplotlib.org/api/prev_api_changes/api_changes_2.0.1.html?highlight=vega

答案 2 :(得分:0)

  

代替Vega10,使用“ tab”颜色图:“ tab10”,“ tab20”,“ tab20b”,“ tab20c”。

sb.boxplot(x='Species', y='Sepal Length', data=df, palette='tab10')