
까이꺼 기냥 하능거지 모-
생각이 많아지면 행동으로 옮기기 어려워! 그러니까 생각은 최소한으로 하고 just do that!

https://matplotlib.org/stable/gallery/index.html
import matplotlib.pyplot as plt
tip #1: 그래프 화장 좋게 만드는 법
%config InlineBackend.figure_format = "retina"
입력 후 실행 😁😁😁
tip #2: matplotlib은 기본적으로 한글을 지원하지 않지만, 한글 출력하는 방법은 있음
'!pip install koreanize_matplotlib'
입력 후 실행 😁😁😁
datas = np.random.randint(1, 11, size=10)
# 1. 그림 그릴 도화지 설정!
plt.figure() # 도화지 크기 설정: plt.figure(figsize=(5, 5))
# 2. 그림 그릴 내용 설정
# plot(x축, y축)
plt.plot([1, 2, 3], [10, 20, 30]]
plt.title("matplotlib")
plt.xlabel("time")
plt.ylabel("python score")
# 3. 그림 보여줘!
plt.show() # 이 부분은 생략 가능!
output: 
# 데이터 생성
categories = ["상의", "하의", "외투"]
price = [30000, 10000, 100000]
plt.figure()
plt.bar(categories, price)
plt.show()
output: 
# 정규분포에서 랜덤한 값 1000개 생성
data = np.random.rand(1000)
plt.figure()
plt.hist(data)
plt.show()
output: 
father = [170, 175, 178, 180, 183]
son = [165, 170, 180, 183, 185]
plt.figure(figsize=(5, 5))
plt.scatter(father, son)
plt.title("부모와 자식 키의 상관관계")
plt.xlabel("부모의 키")
plt.ylabel("자식의 키")
plt.show()
output: 
labels = ["파이썬", "넘파이", "판다스", "태블로"]
level = [80, 23, 32, 10]
colors = ["gold", "yellow", "green", "blue"]
plt.figure(gidsize=(3, 3))
# 그래프를 그린다 -> 데이터 필요 -> 숫자는 반드시 있어야 함
plt.pie(level, labels=labels, colors=colors)
plt.show()
output: 
tip #3: 원하는 색상으로 차트를 작성하고 싶을 때 (구글에서 'colorpicker' 검색 -> hex값 복사)
plt.bar(months, sales, color="#34eb92")
이 형태로 작성하면 됨
by Heidi J. 꼬꼬마 데분가 💜