seaborn scatterplot scale bubble size to larger dots

Solution 1:

Apparently, you also need to use the sizes parameter in seaborn.scatterplot to achieve specified size range.

minsize = min(tips['size'])
maxsize = max(tips['size'])
ax = sns.scatterplot(x="total_bill", y="tip",
                    hue="size", size="size", sizes=(minsize, maxsize),
                    palette=cmap,
                    data=tips)

enter image description here

Solution 2:

Thx for this method! it works great. I had the same issue when setting big size fig with a lot of data. scatter appeared so tiny I couldn't distinguish the size. so first set the tupple, the inject it into sns.scatter

btw, with this method you can play on minsize and maxsize with a multpiply factor without changing the actual data of size and thus the legend. I had to put minsize and maxsize to fifth power to make it readable! thank you so much!

minsize = min(df['value'])**5
maxsize = max(df['value'])**5
fx= sns.scatterplot(x=df['this'], y=df['that'], data=df, hue=df['takeway'], size=df['value'], sizes=(minsize, maxsize), legend='brief')