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.
To set the size of markers, we can use the s parameter. This parameter can be used since seaborn is built on the matplotlib module. We can specify this argument in the scatterplot() function and set it to some value. Alternatively, we can control the size of the points based on some variables.
lmplot() method is used to draw a scatter plot onto a FacetGrid.
The lineplot (lmplot) is one of the most basic plots. It shows a line on a 2 dimensional plane. You can plot it with seaborn or matlotlib depending on your preference. The examples below use seaborn to create the plots, but matplotlib to show.
The despine() is a function that removes the spines from the right and upper portion of the plot by default. sns. despine(left = True) helps remove the spine from the left.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With