-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseeborn.py
More file actions
91 lines (47 loc) · 1.43 KB
/
seeborn.py
File metadata and controls
91 lines (47 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
a=sns.load_dataset("flights")
sns.relplot(x="passengers", y="month", data=a)
a=sns.load_dataset("flights")
sns.relplot(x="passengers", y="month", hue="year", data=a)
b=sns.load_dataset("tips")
sns.relplot(x="time", y="tip", kind="line", data=b)
#Scatter plot
sns.catplot(x="day", y="total_bill", data=b)
#Violin plot
sns.catplot(x="day", y="total_bill", kind="violin", data=b)
#Boxen plot
sns.catplot(x="day", y="total_bill", kind="boxen", data=b)
from scipy import stats
#For univariate distributions
c=np.random.normal(loc=5, size=100, scale=2)
sns.distplot(c)
sns.displot(c)
#Bivariate distributions
#Multiple Graphs
a=sns.load_dataset("iris")
b=sns.FacetGrid(a, col="species")
b.map(plt.hist, "sepal_length")
#Pair Grid
a=sns.load_dataset("flights")
b=sns.PairGrid(a)
b.map(plt.scatter)
#Adding some Aesthetics
sns.set(style="dark")
a=sns.load_dataset("flights")
b=sns.PairGrid(a)
b.map(plt.scatter)
#for boxplot
sns.set(style="white", color_codes=True)
a=sns.load_dataset("tips")
sns.boxplot(x="day", y="total_bill", data=a)
# boxplot
sns.set(style="white", color_codes=True)
a=sns.load_dataset("tips")
sns.boxplot(x="day", y="total_bill", data=a)
sns.despine(offset=10, trim=True)
#colors
c=sns.color_palette()
sns.palplot(c)