绘制两个散点图时创建颜色条

时间:2019-10-09 20:10:08

标签: python matplotlib seaborn

我目前正在用数据创建两个散点图,因为我想在点上进行渐变着色。


sns.scatterplot(x='date', y='cum_vol', data=_df[_df['col']=True],
               hue='col2', marker='D',palette=cmap)

cmap = sns.cubehelix_palette(dark=1-.45, light=1-.28, as_cmap=True)
sns.scatterplot(x='date', y='cum_vol', data=_df[_df['col']=False],
               hue='col2', marker='D',palette=cmap)```

The values `cum_vol`range from 0.28 to 0.72. I want to add a color bar to this plot that captures this coloring.

0 个答案:

没有答案