#44 Control axis limits of plot | seaborn





Control the limits of the X and Y axis of your plot using the matplotlib function plt.xlim and plt.ylim.








# library & dataset
import seaborn as sns
df = sns.load_dataset('iris')

# basic scatterplot
sns.lmplot( x="sepal_length", y="sepal_width", data=df, fit_reg=False)

# control x and y limits
sns.plt.ylim(0, 20)
sns.plt.xlim(0, None)


Leave a Reply

Your email address will not be published.