I have two distributions plotting in a seaborn jointplot like so:
graph = sns.jointplot(setosa.sepal_width, setosa.sepal_length,
cmap="Reds", kind="kde", marginal_kws={"color":"r", "alpha":.2}, shade=True, shade_lowest=False, alpha=.5)
graph.x = virginica.sepal_width
graph.y = virginica.sepal_length
graph.plot_joint(sns.kdeplot, cmap="Blues", shade=True, shade_lowest=False, alpha=.5)
ax = plt.gca()
ax.legend(["setosa", "virginica"])
graph.plot_marginals(sns.kdeplot, color='b', shade=True, alpha=.2, legend=False)
Notice on the legend, that the setosa
and virginica
have no color to their left. Is there any way to correctly add a legend to a jointplot in seaborn?