matplotlib.pyplot 이용하여 그래프 꾸미기 [2018.09.12]

Posted by 센큐
2018. 9. 13. 00:04 Mathematica&Python

fig = matplotlib.pyplot.figure(1)    #figure 1번 생성.

ax = fig.add_subplot(3, 2, 1)    #3행 2열짜리 배열 중 1번째 자리에 ax이라는 subplot을 fig에 생성.

ax.plot(x, y)    #x array, y array 그래프 그리기.

ax.ticklabel_format(style = 'sci', scilimits = (-3, 5), axis='both', useMathText = True)    #'sci'entific notation, 10^(-3)~10^5 이외 구역 적용

ax.tick_params(direction='in')    #ticklabel 그래프 안쪽으로 넣기. (기본은 바깥쪽.)