matplotlib.pyplot.scatter()
有一个facecolors=None
参数将使数据点看起来内部是空心的。如何获得相同的外观seaborn.jointplot()
?
在早期版本的seaborn中也发现了相同的论点,但由于某种原因在最新版本(0.11)中被删除。
如何去掉剧情中的图例seaborn.JoingGrid
?
参考代码如下:
import matplotlib.pyplot as plt
import seaborn as sns
penguins = sns.load_dataset("penguins")
g = sns.JointGrid(data=penguins, x="bill_length_mm", y="bill_depth_mm", hue="species")
g.plot_joint(sns.scatterplot)
sns.boxplot(data=penguins, x=g.hue, y=g.y, ax=g.ax_marg_y)
sns.boxplot(data=penguins, y=g.hue, x=g.x, ax=g.ax_marg_x)
plt.show()
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下已知适用于其他seaborn地块的方法,但在jointplot上失败了:
plt.legend([],[], frameon=False)
g._legend.remove()
Run Code Online (Sandbox Code Playgroud)