Home > Net >  Seaborn - ScatterPlot with Average Y-axis
Seaborn - ScatterPlot with Average Y-axis

Time:03-04

I have written the below code in the seaborn scatterplot for the visual to create

sns.scatterplot(x="Year_Birth", y="NumStorePurchases", data=md)

I get the plot in the format below

enter image description here

I now need the average of the Y- axis and want to adjust the plot to look like the below picture

enter image description here

I have tried using the np.mean in the estimator but it has not worked out. Is there something that is being wrongly done? How this can be achieved?

CodePudding user response:

If you only want one y-value for each x-value, you can create a sns.pointplot(...,orient='v'). Note that a sns.pointplot

  • Related