[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..