본문 바로가기

공부는 언제까지 해야 하나

[Python] matplotlib module - plot( )

import matplotlib.pyplot as plt

 

plt.plot(*args)

 - y value list, x default [0,1,2,3]

 - plt.show() : display figure, jupyter notebook에서는 필요없음

plt.ylable( 'str' )

plt.legend( )

 - plt.plot( index = 'str' )

plt.axis( [ x축 시작, x축 끝, y축 시작, y축 끝 ] )

plt.title( 'str' )

plt.savefig('file name')

한번에 표현도 가능 (대신 label/legend 등 option은 불가)

plt.xticks(x, ('G1', 'G2', 'G3', 'G4'))

 - 문자 지정

plt.yticks([10,20,30,40])

 - 크기 지정