Commit 534b26f1f0869766b51cd88aa4083b2a21ee7822

Authored by Jürgen Knödlseder
1 parent 3f66d021

Fix show_spectrum.py for all matplotlib versions

Showing 1 changed file with 5 additions and 1 deletions
examples/show_spectrum.py
... ... @@ -165,6 +165,9 @@ def get_spectrum_fits(fits):
165 165 return spec
166 166  
167 167  
  168 +# ========================= #
  169 +# Plot delta log-likelihood #
  170 +# ========================= #
168 171 def plot_dloglike(spec):
169 172 """
170 173 Plot delta log-likelihood
... ... @@ -198,7 +201,8 @@ def plot_dloglike(spec):
198 201 dll_hist = [[row[i] for row in dll_hist] for i in range(steps)]
199 202  
200 203 # Plot the likelihood profiles
201   - plt.pcolormesh(spec['engs_scan'], y_bounds, dll_hist, vmin=-10.0, vmax=0.0,
  204 + plt.pcolormesh(np.array(spec['engs_scan']), y_bounds,
  205 + np.array(dll_hist), vmin=-10.0, vmax=0.0,
202 206 cmap='Reds', alpha=0.9)
203 207 cbar = plt.colorbar()
204 208 cbar.set_label(r'$\Delta$ log-likelihood')
... ...