[英]changing the marker size in python seaborn lmplot
I am trying to change the size of the lmplot markers in seaborn. 我试图改变seaborn中的lmplot标记的大小。 I have tried passing 's' or 'size' as arguments and neither of them work.
我试过传递's'或'size'作为参数,但它们都不起作用。
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. 我试过“s”,“markersize”,“size”我没有效果。 I want to make the data points larger on the plot.
我想在图上使数据点更大。 Any help is much appreciated.
任何帮助深表感谢。
You want to use scatter_kws={"s": 100}
你想使用
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. 您可以修改整数值(当前为100)以更改标记的大小。
I don't know what your hue
or palette
data are, but this should work nonetheless. 我不知道您的
hue
或palette
数据是什么,但这应该可行。
I know this question specifies lmplot
but thought I would add an answer for how to do this with a seaborn scatterplot
. 我知道这个问题
lmplot
但我想我会为一个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 要更改点的大小,请使用
s
参数
sp = sns.scatterplot(x="x", y="y", hue="dataset", data=df, s=100)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.