1

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


Hari Prasad
  • 1,162
  • 1
  • 10
  • 11

2 Answers2

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

enter image description here

Hari Prasad
  • 1,162
  • 1
  • 10
  • 11
0
sns.regplot(x="Reviews", y="Rating", data=df)
sns.plt.ylim(0, y_lim)

Change the value of y_lim according to your requirements

Aayush Panda
  • 544
  • 4
  • 15