2013-01-23 17 views
4

這是我的問題。我知道有,如果他們是這樣的次要情節在同一圖中不同情節的軸連接的簡單方法:使用matplotlib在不同小區(無子小區)之間鏈接軸

import matplotlib.pyplot as plt 
fig = plt.figure() 
ax1 = fig.add_subplot(211) 
ax2 = fig.add_subplot(212, sharex=ax1) 

但我不知道是否有一種方法做同樣的鏈接(上圖放大時1,我在一個特定軸上的圖2上得到了相同的縮放),當定義兩個不同的數字時(我希望那些圖形彼此遠離,所以我想我不能把它們放在同一個圖中......)

非常感謝!

+0

http://stackoverflow.com/questions/14503423/how-to-enable-disable-easily-shared-axis-using-matplotlib遵循問題 – tacaswell

+0

關於計算器,你應該接受的答案(可能給予好評它),如果它回答你的問題。 – bmu

回答

9

你只是做同樣的事情,但用不同的數字。

import matplotlib.pyplot as plt 
fig = plt.figure() 
ax1 = fig.add_subplot(111) 
fig2 = plt.figure() 
ax2 = fig2.add_subplot(111, sharex=ax1) 
+0

嗯......確實! :)這很簡單! :D非常感謝! – Jdawleer