In [ ]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
In [2]:
titanic = sns.load_dataset('titanic')
titanic
Out[2]:
In [3]:
tips = sns.load_dataset('tips')
tips
Out[3]:
In [5]:
# 배경을 darkgrid 로 설정
sns.set(style='darkgrid')
In [6]:
sns.countplot(x="class", hue="who", data=titanic)
plt.show()
In [7]:
sns.countplot(y="class", hue="who", data=titanic)
plt.show()
In [8]:
sns.countplot(x="class", hue="who", palette='Paired', data=titanic)
plt.show()
In [9]:
# 샘플데이터 생성
x = np.random.randn(100)
In [10]:
sns.distplot(x)
plt.show()
In [11]:
x = pd.Series(x, name="x variable")
sns.distplot(x)
plt.show()
In [12]:
sns.distplot(x, rug=True, hist=False)
plt.show()
In [13]:
sns.distplot(x, rug=False, hist=False, kde=True)
plt.show()
In [14]:
sns.distplot(x, vertical=True)
Out[14]:
In [15]:
sns.distplot(x, color="y")
plt.show()
댓글 없음:
댓글 쓰기