Changing the size of seaborn pairplot markers
Asked Answered
M

3

19

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()
Madera answered 11/2, 2017 at 21:14 Comment(3)
Final example here: seaborn.pydata.org/generated/seaborn.pairplot.htmlAmericano
Thanks, @mwaskom. Do you know where I can find the rest of the arguments for plot_kws?Madera
They are arguments for whatever function is being used to plot in the upper and lower triangle. (In this case, plt.scatter).Americano
A
37

Adding this should solve the issue - just worked for me

plot_kws={"s": 3}
Antinode answered 16/2, 2017 at 14:14 Comment(0)
C
7

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}.

Clambake answered 11/2, 2018 at 4:7 Comment(0)
M
0

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.

Misdemeanor answered 14/3 at 13:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.