File: residplot.py

package info (click to toggle)
seaborn 0.13.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,920 kB
  • sloc: python: 37,249; makefile: 182; javascript: 45; sh: 15
file content (16 lines) | stat: -rw-r--r-- 362 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
Plotting model residuals
========================

"""
import numpy as np
import seaborn as sns
sns.set_theme(style="whitegrid")

# Make an example dataset with y ~ x
rs = np.random.RandomState(7)
x = rs.normal(2, 1, 75)
y = 2 + 1.5 * x + rs.normal(0, 2, 75)

# Plot the residuals after fitting a linear model
sns.residplot(x=x, y=y, lowess=True, color="g")