Ramon Crehuet
Ramon Crehuet

Reputation: 4017

Plot uniform background color with seaborn jointplot

When using seaborn.jointplot with a Kernel Density Estimation, the background of the KDE does not span the whole background of the figure, resulting in ugly white margins, as shown here: enter image description here

Curiously, this only happens when I use stat_func=None. This is my calling command:

sns.jointplot(x=data[:,1], y=data[:,2], 
    kind="kde", space=0, color='blue', stat_func=None);

Ideally, I would like to have the blue background cover all the background so that I could also use xlim and ylim keywords. Alternatively, if I could crop the margins to where the KDE extends, it would suffice.

Upvotes: 3

Views: 2128

Answers (1)

joelostblom
joelostblom

Reputation: 49064

As mentioned in the comments, passing joint_kws={'shade_lowest':False} solves this issue.

Upvotes: 3

Related Questions