diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/cross.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/cross.py b/test/cross.py index 0dbb8c0..de6b9be 100755 --- a/test/cross.py +++ b/test/cross.py @@ -15,8 +15,12 @@ print(data) fig, ax = plt.subplots(figsize=(5, 5)) #clc = ax.plot(data.step.values.astype('float64'), data.isobaricInhPa, data.ccl.transpose()) -clc = ax.imshow(data.ccl.transpose(), extent=(data.step.values.astype(float).min(), data.step.values.astype(float).max(), data.isobaricInhPa.min(), data.isobaricInhPa.max()), aspect='auto', cmap='Blues_r', vmin=0, vmax=100) -plt.colorbar(clc, label='clcov') +#clc = ax.imshow(data.ccl.transpose(), extent=(data.step.values.astype(float).min(), data.step.values.astype(float).max(), data.isobaricInhPa.min(), data.isobaricInhPa.max()), aspect='auto', cmap='Blues_r', vmin=0, vmax=100) +#plt.colorbar(clc, label='clcov') +clc = ax.contourf(data.step.values.astype('float64'), data.isobaricInhPa, data.ccl.transpose(), cmap='Blues_r', vmin=0, vmax=100, levels=9) + +# use Format parameter for n/8 +plt.colorbar(clc, label='clcov', extendfrac=None, ticks=[100*n/8 for n in range(9)], format=lambda x,_: f'{int(x/12.5)}/8') cf = ax.contour(data.step.values.astype('float64'), data.isobaricInhPa, data.t.metpy.convert_units('degC').transpose()) |