Commit c06c8d50 authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Use a contourplot instead of tripcolor.

parent fe281359
......@@ -515,22 +515,20 @@ def maps(args, fig=None):
# if the --no-show flag is not set, plot the map using cartopy
if not args.no_show or args.savefig is not None:
vmaxs = np.max(np.abs(field), axis=1)
vmins = -vmaxs
cmaps = ['RdBu', 'RdBu', 'RdBu']
units = [r'$\mu$T', r'$\mu$T', r'$\mu$T']
levels = [10, 10, 10]
extends = ['neither', 'neither', 'neither']
if args.type == 'dif':
field[2] /= 1000
vmaxs[0] = 40
vmins[0] = -vmaxs[0]
vmaxs[2] /= 1000
vmins[2] = np.min(field[2])
levels[0] = [-40, -30, -20, -10, 0, 10, 20, 30, 40]
levels[1] = np.linspace(-90, 90, 11)
extends[0] = 'both'
cmaps[2] = 'Blues'
units[0] = r'deg.'
units[1] = r'deg.'
else:
vmaxs /= 1000
vmins /= 1000
field /= 1000
cbar_hght = 0.06
......@@ -554,13 +552,11 @@ def maps(args, fig=None):
colaxs = []
for it in range(3):
bnds = axs[it].get_position().bounds
colaxs.append(fig.add_axes([bnds[0]+bnds[2]+0.1+1.5*cbar_hght,
bnds[1],
0.8*cbar_hght,
bnds[3]]))
cbar_orientation = 'vertical'
colaxs.append(fig.add_axes([bnds[0],
bnds[1]-0.02-0.7*cbar_hght,
bnds[2],
0.7*cbar_hght]))
cbar_orientation = 'horizontal'
plt_lat, plt_lon, _ = proj.transform_points(ccrs.Geodetic(),
z_at[1],
......@@ -570,13 +566,14 @@ def maps(args, fig=None):
f'{args.epoch} {args.t_unit}')
for it in range(3):
mappable = axs[it].tripcolor(plt_lat, plt_lon, field[it],
vmin=vmins[it], vmax=vmaxs[it],
rasterized=True, cmap=cmaps[it])
mappable = axs[it].tricontourf(plt_lat, plt_lon, field[it],
cmap=cmaps[it],
levels=levels[it],
extend=extends[it])
axs[it].coastlines(alpha=0.8, lw=0.5)
axs[it].set_global()
axs[it].set_title(f'{utils._names[args.type][it]} [{units[it]}]')
colaxs[it].tick_params(labelsize=12)
fig.colorbar(mappable,
cax=colaxs[it],
orientation=cbar_orientation)
......
Supports Markdown
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