コード例 #1
0
# -- levels
levels = np.linspace(minmax[0], minmax[1], minmax[2])  # Change
#levels = np.arange(33.5,35.5,0.2) # Mean salinity
#levels = np.arange(-2,30,2) # Mean temperature
#levels = np.arange(0,701,50) # Mean volume

ext_cmap = 'both'
contourDict = {
    'cmap': cmap,
    'levels': levels,
    'ext_cmap': ext_cmap,
    'isopyc': False
}

# -- Contourf of signal
cnplot = zon_2Dz(plt, axes[0, 0], axes[1, 0], 'left', lat, targetz, varAtl,
                 contourDict, domzed)
cnplot = zon_2Dz(plt, axes[0, 1], axes[1, 1], 'mid', lat, targetz, varPac,
                 contourDict, domzed)
cnplot = zon_2Dz(plt, axes[0, 2], axes[1, 2], 'right', lat, targetz, varInd,
                 contourDict, domzed)

if name == 'mme_hist' and modelAgree:
    modelagree(axes[0, 0], axes[1, 0], agreelev, lat, targetz,
               var_agreez[1, :, :])
    modelagree(axes[0, 1], axes[1, 1], agreelev, lat, targetz,
               var_agreez[2, :, :])
    modelagree(axes[0, 2], axes[1, 2], agreelev, lat, targetz,
               var_agreez[3, :, :])

# Bathymetry
# for i in range(3):
コード例 #2
0
    # -- Levels
    minmax = [min, finalyear - 20 + 0.1, deltat]
    levels = np.arange(minmax[0], minmax[1], minmax[2])
    ext_cmap = 'both'
    # -- Put everything into a dictionary
    contourDict = {
        'cmap': cmap,
        'levels': levels,
        'levels2': levels,
        'ext_cmap': ext_cmap,
        'isopyc': False
    }

    # -- Contourf
    # Atlantic
    cnplot = zon_2Dz(plt, axes[0, 0], axes[1, 0], 'left', lat, targetz,
                     varAtlmedian, contourDict, domzed)
    cnplot[0].cmap.set_over('0.8')
    cnplot[1].cmap.set_over('0.8')

    # -- Add colorbar
    cb = fig.colorbar(cnplot[1],
                      ax=axes.ravel().tolist(),
                      ticks=levels,
                      fraction=0.015,
                      shrink=2.0,
                      pad=0.05)
    cb.set_label('%s' % (unit, ), fontweight='bold', fontsize=14)
    cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontweight='bold')
    cb.ax.yaxis.set_tick_params(which='major', width=2, labelsize=12)

    # Pacific