Example #1
0
def plot_field(field, fig, clevs, cmap, fill_range=None):
    pl.figure(fig)
    pl.clf()
    n = colors.Normalize()
    n.autoscale(clevs)
    if fill_range is not None:
        m = g5cmaps.FilledCmap(cmap, fill_range=n(fill_range))
    else:
        m = cmap
    p = ptrs.GeoPlotter(copts=dict(levels=clevs, cmap=m, norm=n))
    p(field, stat=True)
    pl.show()
Example #2
0
def plot_field(field, fig, clevs, cmap, fill_range=None):
    pl.figure(fig)
    pl.clf()
    n = colors.Normalize()
    n.autoscale(clevs)
    if fill_range is not None:
        m = g5cmaps.FilledCmap(cmap, fill_range=n(fill_range))
    else:
        m = cmap
    p = ptrs.Plotter2d(copts=dict(levels=clevs, cmap=m, norm=n))
    p(field)
    p.method = pl.contour
    p.copts = dict(levels=clevs[0::2], colors='black')
    p(field)
    ax = p.axis
    ax.set_ylabel('depth, m')
    ax.invert_yaxis()
    return p
Example #3
0
exp.lower = exp.gam(levs=(thresh, 6000))

# Plot

path = exp.plot_path
try:
    os.makedirs(path)
except OSError:
    pass

fig = pl.figure(1)
pl.clf()
clevs = sp.arange(-0.8, 0.81, 0.1)
n = colors.Normalize()
n.autoscale(clevs)
m = g5cmaps.FilledCmap(sstanom, fill_range=n((-0.1, 0.1)))
exp.upper.name = exp.ctl.name + ' ' + varname + ' Anomaly, Global Mean'
p = ptrs.Plotter2d(
    copts=dict(levels=clevs, cmap=m, norm=n),
    # cbar_opts=dict(orientation='horizontal', pad=0.2),
    cbar_opts=None,
    axes=('time', 'lev'))
ax1 = pl.axes([0.1, 0.5, 0.8, 0.4])
#p(exp.gam)
p(exp.upper)
p.method = pl.contour
del p.copts['cmap']
p.copts.update(levels=clevs[0::2], colors='black')
#p(exp.gam)
p(exp.upper)
ax1.invert_yaxis()