Commit 9600bfbe authored by Maxime Rey's avatar Maxime Rey
Browse files

Bugfix: contours were misaligned in 'plot_phase_diag'.

parent 64a82cf6
......@@ -217,11 +217,12 @@ def plot_phase_diag(genpath, folders, timesteps, var_str='H', cgm_gas=False, no_
else:
im = plt.imshow(phase_diag.T,interpolation='nearest',origin='lower',norm=LogNorm(vmin=vmin,vmax=vmax),cmap='BuPu_r', extent=extent)
if folder==folders[0]:
extent_0 = extent
phase_diag_gauss_0 = gaussian_filter(phase_diag, sigma)
phase_diag_gauss_0 = np.ma.masked_where(phase_diag_gauss_0 <= 0, phase_diag_gauss_0)
plt.contour(phase_diag_gauss_0.T,levels=levels,origin='lower',norm=LogNorm(vmin=vmin,vmax=vmax),colors='b', extent=extent)
plt.contour(phase_diag_gauss_0.T,levels=levels,origin='lower',norm=LogNorm(vmin=vmin,vmax=vmax),colors='b', extent=extent_0)
else:
plt.contour(phase_diag_gauss_0.T,levels=levels,origin='lower',norm=LogNorm(vmin=vmin,vmax=vmax),colors='b', extent=extent, linestyles='dashed')
plt.contour(phase_diag_gauss_0.T,levels=levels,origin='lower',norm=LogNorm(vmin=vmin,vmax=vmax),colors='b', extent=extent_0, linestyles='dashed')
phase_diag_gauss = gaussian_filter(phase_diag, sigma)
phase_diag_gauss = np.ma.masked_where(phase_diag_gauss <= 0, phase_diag_gauss)
plt.contour(phase_diag_gauss.T,levels=levels,origin='lower',norm=LogNorm(vmin=vmin,vmax=vmax),colors='k', extent=extent)
......
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