Commit d71abc2b authored by Carl Schreck's avatar Carl Schreck

Revised temp_steps.py

parent 3b59a348
......@@ -33,11 +33,11 @@ tif_name = 'MSR_50M'
cjs.tstamp('Here we go!')
fig, axs = plt.subplots(nrows=3, ncols=1, figsize=(6.4, 9.6),
fig, axs = plt.subplots(nrows=3, ncols=1, figsize=(4.0, 8.0),
subplot_kw={
'projection': ccrs.AlbersEqualArea(
central_longitude=central_longitude),
'anchor': 'N'
'anchor': 'W'
})
i = 0
......@@ -50,10 +50,9 @@ for ax, var_name in zip(axs[:2], var_names):
scaled_ds = xr.open_dataset(scaled_path)
scaled_data = scaled_ds[var_name].sel(time=time).drop('time')
plot = scaled_data.plot(ax=ax, transform=ccrs.PlateCarree(),
add_colorbar=True,
add_colorbar=False,
cmap=cmap, levels=levels, zorder=1,
vmin=-np.inf, vmax=np.inf, extend='both',
cbar_kwargs={'label': '°C',}
)
ax.set_title(f'{cjs.number_to_letter(i)} '
f'{var_name_to_long_name[var_name]}',
......@@ -69,20 +68,28 @@ ax = axs[2]
elev_path = f'{os.environ["DATA_DIR"]}/geography/elev.americas.5-min.nc'
elev_ds = xr.open_dataset(elev_path)
levels = np.arange(800, 3800, 100)
plot = elev_ds['data'][0].plot(ax=ax, transform=ccrs.PlateCarree(),
elev_plot = elev_ds['data'][0].plot(ax=ax, transform=ccrs.PlateCarree(),
cmap='OrRd', add_colorbar=True, zorder=1,
levels=levels,
cbar_kwargs = {'label': 'm', }
)
helpers.draw_station_type(ax=ax, path=station_path, sep=' ',
lat_column=1, lon_column=2, time_column=6,
markersize=36, edgecolor='black')
markersize=36, zorder=50, edgecolor='black')
ax.set_extent(extent)
ax.outline_patch.set_visible(True)
ax.set_title('c) Elevation and station type', loc='left')
ax.set_title('')
ax.set_anchor('W')
# ax.legend()
handles, labels = axs[2].axes.get_legend_handles_labels()
fig.legend(handles, labels, loc='lower center', ncol=2,
markerscale=2)
cb = fig.colorbar(plot, ax=axs[:2], orientation='vertical',
panchor=False, label='°C')
cjs.tstamp('Drawing figure')
plt.tight_layout()
plt.savefig(f'figures/temp_steps.png', dpi=200)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment