Jda*_*eer 5 python plot matplotlib
这是我的问题.我知道有一种简单的方法可以链接不同图的轴,如果它们是这样的同一图中的子图:
import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax2 = fig.add_subplot(212, sharex=ax1)
Run Code Online (Sandbox Code Playgroud)
但我想知道是否有一种方法可以做同样的链接(当放大图1时,我在一个特定轴上得到相同的放大图2)定义2个不同的图形时(我希望这些图形看起来彼此远离所以我想我不能把它们放在同一个图中......)
非常感谢 !
tac*_*ell 10
你只是做同样的事情,但有一个不同的数字.
import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111)
fig2 = plt.figure()
ax2 = fig2.add_subplot(111, sharex=ax1)
Run Code Online (Sandbox Code Playgroud)