I'm trying to plot a very similar situation to the one described in the seaborn documentation at http://seaborn.pydata.org/tutorial/axis_grids.html#plotting-pairwise-relationships-with-pairgrid-and-pairplot
The example in question can be found a few graphs down, plotting an sns.PairGrid
with the iris dataset. They plot the different species on the sample pairgrid, with the species colour coded as hue.
I want to do essentially that, however with kde contour plots. I've got the data in the same type of format as them:
new_HP.head()
A C logsw Mass Range
0 -3.365547 0.977325 6.172032 0
1 -0.836703 0.962374 5.949639 0
2 -0.522476 0.931787 5.967940 0
3 -0.508345 0.974561 5.929046 0
4 -0.753747 0.905854 6.027479 0
With "Mass Range" taking values 0,1,2,3. With
g = sns.PairGrid(new_HP, vars=['A', 'C', 'logsw'], hue="Mass Range")
g.map_diag(sns.kdeplot)
g.map_lower(sns.kdeplot)
g.map_upper(plt.scatter)
I get the following plot
I would like to set the colours of the kde countours for each "Mass Range" bin, just like in the top right where the colour of the scatter points is shown as the hue. How can I do this?