seaborn scatterplot marker size for ALL markers

时间秒杀一切 提交于 2021-02-07 11:13:29

问题


I can't find out anywhere how to change the marker size on seaborn scatterplots. There is a size option listed in the documentation but it is only for when you want variable size across points. I want the same size for all points but larger than the default!

I tried making a new column of integers in my dataframe and set that as the size, but it looks like the actual value doesn't matter, it changes the marker size on a relative basis, so in this case all the markers were still the same size as the default.

Edit: here's some code

ax = sns.scatterplot(x="Data Set Description", y="R Squared", data=mean_df)
plt.show()

I just tried something and it worked, not sure if it's the best method though. I added size=[1, 1, 1, 1, 1, 1] and sizes=(500, 500). So essentially I'm setting all sizes to be the same, and the range of sizes to be only at 500.


回答1:


You can do so by giving a value to the s argument to change the marker size.

Example:

ax = sns.scatterplot(x="Data Set Description", y="R Squared", data=mean_df, s=10)


来源:https://stackoverflow.com/questions/52785101/seaborn-scatterplot-marker-size-for-all-markers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!