您好我的笔记本电脑上安装了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
列为众多彩色地图之一。
答案 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')