import numpy as np
import pandas as pd
import scipy
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.manifold import TSNE
plt.plot( x, y, color, linewidth, linestyle, label, ...)
color=’red’, ‘green’ 등 가능
linestyle = ‘dashed’, ‘solid’ 가능
스타일 단축어로 표기 가능 예시 color=’red’, linestyle=’dashed’를 ‘r--’로 줄일 수 있음
plt.plot(x, x**2, 'r--', linewidth=2)
‘r--’ : red에 dashed line 됨 ’b-’ : blue에 그냥 solid line ’go’: green에 point 모양 찍힘
label: 데이터 이름 지정 가능, 나중에 plt.legend()하면 범례에 나옴
plt.scatter(x, y, color, label, ...)
line과 동일하다.
n,bins,patches = plt.hist(stat, bins, color, alpha, ... )
n은 각 막대가 가지는 값, bins는 각 막대의 위치, patches는 각 막대 오브젝트 → patches[index].set_alpha 이렇게 특정 막대를 접근해 조작 가능
Quantile을 계산해서 그냥 plot으로 그리면 된다.
plt.plot(np.quantile(a,q/100), 'ro')
Quantile 두개로 Scatter 그리면 된다.