부스트캠프 AI Tech/Data Viz (4) 썸네일형 리스트형 [03] Line Plot Line Plot¶ In [1]: import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt In [2]: fig, axes = plt.subplots(1, 2, figsize=(12, 7)) x1 = [1, 2, 3, 4, 5] x2 = [1, 3, 2, 4, 5] y = [1, 3, 2, 1, 5] axes[0].plot(x1, y) axes[1].plot(x2, y) plt.show() In [3]: fig = plt.figure(figsize=(5, 5)) ax = fig.add_subplot(111, aspect=1) n = 1000 x = np.sin(np.linspace(0, 2*.. [02] Bar Plot Bar Plot¶ In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt barh 와 bar color 주기¶ # fig = plt.figure(12,7) # axes = fig.subplots(1,2) fig, axes = plt.subplots(1,2, figsize=(12,7)) x = list('ABCED') y = list(range(1,6)) clist = ['tomato', 'g', 'r', 'm', 'b'] axes[0].bar(x,y, color = clist) # 리스트로 개별 막대 색 주기 axes[1].barh(x.. [01] matplotlib In [1]: import numpy as np import matplotlib as mpl print(f'numpy version : {np.__version__}') # version check print(f'matplotlib version : {mpl.__version__}') # version check numpy version : 1.19.5 matplotlib version : 3.5.0 In [2]: import matplotlib.pyplot as plt In [3]: fig = plt.figure() plt.show() figure라는 큰 틀(figsize로 사이즈 조정). ax 는 서브플롯(그래프)라고 생각¶ In [14]: fig = plt.figure(figsize=(5,4)) a.. [00] Markdown 이전 1 다음 1/1