0

I have a pandas dataframe with three columns (A,B,C). I have drawn a regression line of A vs B using

sns.lmplot(x='A', y='B', data = df, x_bins=10, ci=None)

I am using 10 bins and no confidence interval as I have a large number (~5million) datapoints.

I would like to show the value of C on this plot. C has nothing to do with the regression of A against B. I would just like to show C by making the marker size of each bin equal to the average value of C within that bin.

It seems seaborn doesn't have a markersize parameter that can be set equal to a column of the dataframe. Is this even possible?

I cam across this stackexchange post which suggests using scatter_kws={"s": 100} to set the marker size. However, when I tried scatter_kws={"s": df['C']} it threw an error.

If this is not possible in seaborn, are there any alternative solutions?

user11128
  • 295
  • 1
  • 2
  • 12

0 Answers0