diff --git a/examples/show_spectrum.py b/examples/show_spectrum.py index 18f18be..5a5a6f9 100755 --- a/examples/show_spectrum.py +++ b/examples/show_spectrum.py @@ -2,7 +2,7 @@ # ========================================================================== # Display spectrum generated by csspec # -# Copyright (C) 2015-2016 Juergen Knoedlseder +# Copyright (C) 2015-2017 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -91,6 +91,9 @@ def plot_spectrum(filename, plotfile): ul_ed_engs.append(c_ed.real(row)) ul_eu_engs.append(c_eu.real(row)) + # Set upper limit errors + yerr = [0.6 * x for x in ul_flux] + # Plot the spectrum plt.figure() plt.loglog() @@ -98,7 +101,7 @@ def plot_spectrum(filename, plotfile): plt.errorbar(energies, flux, yerr=e_flux, xerr=[ed_engs, eu_engs], fmt='ro') plt.errorbar(ul_energies, ul_flux, xerr=[ul_ed_engs, ul_eu_engs], - yerr=1.0e-11, uplims=True, fmt='ro') + yerr=yerr, uplims=True, fmt='ro') plt.xlabel('Energy (TeV)') plt.ylabel(r'E $\times$ dN/dE (erg cm$^{-2}$ s$^{-1}$)')