-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Description
Seaborn versions: latest dev version and 0.11.1
lmplot
doesn't seem to accept the xlim=
parameter, although FacetGrid does.
Use case: when truncate=False
, the regression lines are extrapolated until they touch the current xlims. If one afterwards want to extend these xlims, the regression lines are floating again. A workaround is either to call FacetGrid and regplot separately, or to set very wide xmargins via the rcParams.
Example code.
import seaborn as sns
import matplotlib as mpl
tips = sns.load_dataset('tips')
# mpl.rcParams['axes.xmargin'] = 0.5 # set very wide margins: 50% of the actual range
g = sns.lmplot(x="total_bill", y="tip", col="smoker", data=tips, truncate=False, xlim=(0, 80))
# mpl.rcParams['axes.xmargin'] = 0.05 # set the margins back to the default
g.set(xlim=(0, 80))