子图中的sharex和sharey-无响应

时间:2018-10-09 13:24:45

标签: python matplotlib subplot

我试图将sharex和sharey用于一组子图,但是当我将它们设置为“ True”时,什么也没有发生。我看不到有什么原因吗?谢谢

for loci in locis:
    for parameter in paramlist:

        cols = ['Leadtime: {}'.format(col) for col in leadtimes]
        rows = ['Fx_version: {}'.format(row) for row in fx_version]

        # Create figure
        fig, axes = plt.subplots(len(fx_version), len(leadtimes), sharex=True, sharey=True,figsize=(20,20))
        fig.subplots_adjust(left=0.075,right=0.975,top=0.875, bottom=0.025)
        #

        for index_version, version in enumerate(fx_version):
            for index_lead,lead in enumerate(leadtimes):


               veri.plot_ctable(starttime, endtime, lead, version, loci, parameter, axes, index_lead, index_version)

        # Title
        title = "Contingency table for %s at %s between %s and %s"  % (paramdict_longwords[parameter], loci, starttime, endtime)
        fig.suptitle(title)

        for ax, col in zip(axes[0], cols):
                ax.annotate(col, xy=(0.5, 1.2), xytext=(10, 5),
                xycoords='axes fraction', textcoords='offset points',
                size='medium', ha='center', va='baseline')

        for ax, row in zip(axes[:,0], rows):
            ax.set_ylabel(row, rotation=90, size='medium')

        # Save figure
        figure_save_name = "ContingencyTable_%s_%s_from_%s_to_%s.png" % (parameter, loci, starttime, endtime)
        plt.savefig(figure_save_name)


return    

0 个答案:

没有答案