2009-09-10 5 views

답변

6

subplot을 사용하면 동일한 캔버스에 둘 이상의 그림을 그릴 수 있습니다. 링크 된 문서 페이지의 예를 참조하십시오. 예제 디렉토리의 공유 축 플롯의 예입니다

shared_axis_demo.py 전화 :

from pylab import * 

t = arange(0.01, 5.0, 0.01) 
s1 = sin(2*pi*t) 
s2 = exp(-t) 
s3 = sin(4*pi*t) 
ax1 = subplot(311) 
plot(t,s1) 
setp(ax1.get_xticklabels(), fontsize=6) 

## share x only 
ax2 = subplot(312, sharex=ax1) 
plot(t, s2) 
# make these tick labels invisible 
setp(ax2.get_xticklabels(), visible=False) 

# share x and y 
ax3 = subplot(313, sharex=ax1, sharey=ax1) 
plot(t, s3) 
xlim(0.01,5.0) 
show() 
관련 문제