简体   繁体   中英

changing the marker size in python seaborn lmplot

I am trying to change the size of the lmplot markers in seaborn. I have tried passing 's' or 'size' as arguments and neither of them work.

lm = sns.lmplot(x="totalX",y="NormI", hue="Data Type", data=df, palette="Set1", legend_out=False, S=20)

I have tried "s", "markersize", "size" I get no effect. I want to make the data points larger on the plot. Any help is much appreciated.

You want to use scatter_kws={"s": 100}

As in:

lm = sns.lmplot(x = "totalX", y = "NormI", hue = "Data Type", data = df, palette="Set1", legend_out=False, scatter_kws={"s": 100})

You can amend the integer value (currently 100) to change the size of the markers.

I don't know what your hue or palette data are, but this should work nonetheless.

I know this question specifies lmplot but thought I would add an answer for how to do this with a seaborn scatterplot .

df = sns.load_dataset("anscombe")
sp = sns.scatterplot(x="x", y="y", hue="dataset", data=df)

在此输入图像描述

And to change the size of the points you use the s parameter

sp = sns.scatterplot(x="x", y="y", hue="dataset", data=df, s=100)

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM