I searched but I did not find the answer regrading the seaborn library. I also checked the documentation for lmplot()
and regplot()
, but did not find either.
Is it possible to extend and control the length of regression lines? By default seaborn fits the length of regression line according to the length of x axis. Another option is to use argument truncate=True
- that would limit the regression line only to the extent of data.
Other options?
In my example I want the lower regression line to be extended down till x=0. And the upper line extended till the intersection with the lower one.
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
file = 'cobbles.csv'
df = pd.read_csv(file, sep=',')
sns.regplot(x='downward_temp', y='downward_heat', data=df, ci=None)
sns.regplot(x='upward_temp', y='upward_heat', data=df, ci=None, order=2)
plt.xlim([0,25])
plt.ylim([0,100])
plt.show()