【发布时间】:2022-01-25 07:43:58
【问题描述】:
当我运行以下代码时,我得到了一个情节:
tmp = sns.lineplot(
data=inf_algs_results_df,
x='alpha',
y='runtime',
hue='beta_rounded',
)
但是当我尝试用颜色条替换图例时,颜色条会错误地反转颜色!
tmp = sns.lineplot(
data=inf_algs_results_df,
x='alpha',
y='runtime',
hue='beta_rounded',
)
tmp.figure.colorbar(
mpl.cm.ScalarMappable(
norm=mpl.colors.Normalize(vmin=inf_algs_results_df['beta_rounded'].min(),
vmax=inf_algs_results_df['beta_rounded'].max(),
clip=False)),
label=r'$\beta$')
plt.show()
为什么颜色条会翻转,我该如何停止?
【问题讨论】:
标签: python matplotlib seaborn