seaborn "kde jointplot" doesn't have color mapping in the latest version (0.11.0)

Viewed 2094

I was running seaborn ver. 0.10.1 on my jupyter notebook. This morning I upgraded to the latest version 0.11.0. Now, my kde jointplot doesn't give the color mapping that it used to. The code is the same. Only the versions are different.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

%matplotlib notebook

np.random.seed(1234)

v1 = pd.Series(np.random.normal(0,10,1000), name='v1')
v2 = pd.Series(np.random.normal(60,15,1000), name='v2')
v3 = pd.Series(2*v1 + v2, name='v3')

# set the seaborn style for all the following plots
sns.set_style('white')

sns.jointplot(v1, v3, kind='kde', space=0);

Link to the image (This is my first question, I can't embed an image)

1 Answers

The function kdeplot (which is used internally by jointplot()to draw the bivariate density plot) has been extensively changed in v.0.11. See What's new and the documentation.

You now have to pass fill=True to get a filled KDE, and you need to specify thresh=0 if you want to fill the available space with color.

sns.jointplot(x=v1, y=v3, kind='kde', space=0, fill=True, thresh=0, cmap='Blues');

enter image description here

Related