How to change marker size in seaborn.catplot
Use s instead of size. the default s is 5.
Example:
sns.catplot(x = "time", y = "total_bill", s = 20, data = tips)
sns.catplot(x = "time", y = "total_bill", s = 1, data = tips)
There is a conflict between the parameter 'size' in sns.stripplot
and the deprecated 'size' of sns.catplot
, so when you pass 'size' to the latter, it overrides the 'height' parameter and shows the warning message you saw.
Workaround
From looking inside the source code, I've found that 's' is an alias of 'size' in sns.stripplot
, so the following works as you expected:
g=sns.catplot(data=public, x="age", y="number", col="species", kind="strip", jitter=True, order=order, s=20, palette=palette, alpha=0.5, linewidth=3, height=6, aspect=0.7)
According catplot doc https://seaborn.pydata.org/generated/seaborn.catplot.html the underlying strip
you are using is documented here: https://seaborn.pydata.org/generated/seaborn.stripplot.html#seaborn.stripplot
Quoting:
size : float, optional
Diameter of the markers, in points. (Although
plt.scatter
is used to draw the points, thesize
argument here takes a “normal” markersize and not size^2 likeplt.scatter
).
So size=20
seems to be a perfectly valid parameter to give to catplot. Or any other value that suits your needs.
Copy pasta code with screens from seaborn documentation pages provided above...
import seaborn as snssns.set(style="whitegrid")tips = sns.load_dataset("tips")ax = sns.stripplot(x=tips["total_bill"])ax = sns.stripplot("day", "total_bill", "smoker", data=tips, palette="Set2", size=20, marker="D", edgecolor="gray", alpha=.25)