보조 Y 축 (트윈스을 사용하여 생성)이 포함 된 여러 개의 서브 플로트가있는 경우 보조 플롯간에 보조 Y 축을 어떻게 공유 할 수 있습니까? 나는 그들이 자동적으로 똑같이 확장되기를 바란다. (나중에 y 한계를 수동으로 설정하지 않는다.) 기본 y 축의 경우 sharey을 서브 플롯으로 호출하여 사용할 수 있습니다.matplotlib에서 보조 플롯 간의 보조 y 축 공유 방법
아래 예제는 내 시도를 보여 주지만 두 subplots의 보조 y 축을 공유하지 못합니다. 나는하기 matplotlib/Pylab을 사용하고 있습니다 :
ax = []
#create upper subplot
ax.append(subplot(211))
plot(rand(1) * rand(10),'r')
#create plot on secondary y-axis of upper subplot
ax.append(ax[0].twinx())
plot(10*rand(1) * rand(10),'b')
#create lower subplot and share y-axis with primary y-axis of upper subplot
ax.append(subplot(212, sharey = ax[0]))
plot(3*rand(1) * rand(10),'g')
#create plot on secondary y-axis of lower subplot
ax.append(ax[2].twinx())
#set twinxed axes as the current axes again,
#but now attempt to share the secondary y-axis
axes(ax[3], sharey = ax[1])
plot(10*rand(1) * rand(10),'y')
이 나에게 같은 것을 가져옵니다
나는 축을 사용하는 이유() 기능을 공유 y 축이 있다는 것입니다 설정 twinx은 sharey 키워드를 허용하지 않습니다.
저는 Win7 x64에서 Python 3.2를 사용하고 있습니다. Matplotlib 버전은 1.2.0rc2입니다.
네, 저에게 도움이되었습니다. 감사합니다. 또한 기본 y 축을 결합하여 y 축을 공유하도록했습니다. – Puggie
기꺼이 도와 드리겠습니다. 인터넷 포인트를 가져 주셔서 감사합니다. – dmcdougall
두 번째 트윈 눈금은 업데이트되지 않지만 두 번째 트윈 눈금은 그대로 유지됩니다. – Mattia