Changing the size of seaborn pairplot markers

Question:

I’m trying to plot a seaborn.pairplot with small dots like this one:
enter image description here

But I get one with the markers much bigger and I can’t find how to change their size in the documentation. My pairplot looks like this:

enter image description here

The code I’m using to plot is:

sns.pairplot(df, diag_kind='kde')
sns.plt.show()
Asked By: Danowsky

||

Answers:

Adding this should solve the issue – just worked for me

plot_kws={"s": 3}
Answered By: jjrr

Just to clarify the above answer in that plot_kws = {“s”:3} is a dictionary with size (“s”) set to the value of 3. You can increase or decrease the value as you like. For example you can do plot_kws = {“s”:1}.

Answered By: Samuel Nde

Unfortunatelly, the given did not fix the problem since the plot_kws parameter given to sns.pairplot is forwarded ro sns.regplot, which itself accepts a scatter_kws argument, which in the end is passed to plt.scatter() and actually draws the scatter plot.

Very nested, but

sns.pairplot(data, kind="reg", plot_kws=dict(scatter_kws=dict(s=3)))

should work.

Credits should go this answer, where Diziet answered it.

Answered By: azabicki
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.