matplotlib子图选择性轴共享

时间:2018-09-13 02:41:45

标签: python matplotlib

我有8个数字(4行2列)。我希望所有数字共享一个轴,除了一个。在matplotlib中无需手动操作就可以做到吗?

示例:

fig = plt.figure();
ax = fig.subplots(4,2,sharex='all',sharey='all')
for j in np.arange(4):
    plt.sca(ax[j,0])
    plt.plot(np.random.random(5),'.')
    plt.sca(ax[j,1])
    plt.plot(np.arange(5),'.')
plt.sca(ax[0,0])
# Code here to unlink this one axis from the shared system
plt.gca().set_yscale('log',basey=10) # I only want this one axis to be log

0 个答案:

没有答案