matplotlibdata-scienceseaborneda

sns.regplot set limit on regression line y axis


For the given seaborn plot, how do we set the regression line y-axis limit within 5.
The rating never crosses 5. Is there a way to truncate/clip it? sns.regplot(x="Reviews", y="Rating", data=df);


enter image description here



Solution

  • g = sns.regplot(x="Reviews", y="Rating", data=df);
    g.set(ylim=(None, 5))
    plt.title('Rating VS Reviews')
    

    enter image description here