How to adjust the x axis in seaborn.regplot

Viewed 423

I need help to adjust the x axis to 300. I am using sns.regplot.

import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

sns.set(style="ticks", color_codes=True)

dataset = pd.read_csv('ocv.csv')

sns.regplot(data=dataset, x='gdl', y='sales')
sns.regplot(data=dataset, x='lft', y='sales')
sns.regplot(data=dataset, x='newspaper', y='sales')

1

1 Answers

You can control the limits of X and Y axis of your plots using matplotlib function plt.xlim() and plt.ylim().

You just need to add plt.xlim(0,300) to your code.

Related