seaborn.
residplot
(*, x=None, y=None, data=None, lowess=False, x_partial=None, y_partial=None, order=1, robust=False, dropna=True, label=None, color=None, scatter_kws=None, line_kws=None, ax=None)¶Plot the residuals of a linear regression.
This function will regress y on x (possibly as a robust or polynomial regression) and then draw a scatterplot of the residuals. You can optionally fit a lowess smoother to the residual plot, which can help in determining if there is structure to the residuals.
Data or column name in data
for the predictor variable.
Data or column name in data
for the response variable.
DataFrame to use if x
and y
are column names.
Fit a lowess smoother to the residual scatterplot.
Matrix with same first dimension as x
, or column name(s) in data
.
These variables are treated as confounding and are removed from
the x
or y
variables before plotting.
Order of the polynomial to fit when calculating the residuals.
Fit a robust linear regression when calculating the residuals.
If True, ignore observations with missing data when fitting and plotting.
Label that will be used in any plot legends.
Color to use for all elements of the plot.
Additional keyword arguments passed to scatter() and plot() for drawing the components of the plot.
Plot into this axis, otherwise grab the current axis or make a new one if not existing.
Axes with the regression plot.
See also
regplot
Plot a simple linear regression model.
jointplot
Draw a residplot()
with univariate marginal distributions (when used with kind="resid"
).