使用Seaborn,无论我使用的是什么数据帧,或者我使用的是PairPlot还是jointgrids,我的图例都会与数据重叠。我知道我可以通过删除Seaborn的传奇并制作自定义传奇来解决这个问题,但是,这不是“最干净”的路线。如何让Seaborn创建不重叠的图例
下面是一些代码:
g = sns.pairplot(df, kind="reg", plot_kws={"marker": "+"}, hue="experiment", palette="Set2", x_vars=["alpha [%]", "shelter [%]", "beta [%]"], y_vars=["final [%]"])
plt.show()
(顺便说一句,我使用的是Mac OS、Pycharm、Python 3.6seaborn 0.10.0和matplotlib 3.3.3)
看来你不能用
pairplot
来做这件事In the docs they say:使用this ^{} example from the docs ,可以将
loc
参数传递给add_legend()
方法可以传递给
loc
参数的参数列在Matplotlib docs中相关问题 更多 >
编程相关推荐