以@ user308827的答案为基础:您可以
legend=False在factorplot中使用并通过matplotlib指定图例:
import seaborn as snsimport matplotlib.pyplot as pltsns.set()titanic = sns.load_dataset("titanic")g = sns.factorplot("class", "survived", "sex", data=titanic, kind="bar", size=6, palette="muted", legend=False)g.despine(left=True)plt.legend(loc='upper left')g.set_ylabels("survival probability")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)