Beispiel #1
0
#! /usr/bin/env python2
"""Example for plotting a YODA histogram using heppyplotlib."""
import matplotlib.pyplot as plt
import heppyplotlib as hpl

# you can disable the usage of Rivet plot info
# also histogram errors might be omitted
hpl.plot("Analysis.yoda", "/ANALYSIS/OBSERVABLE",
         uses_rivet_plot_info=False,
         errors_enabled=False)

# hpl.plot calls plt.plot in the end, so you can use normal pyplot commands to customize
plt.xlabel(r'$p_T$')
plt.yscale('log')

plt.show()
plt.savefig('plot.pdf')
Beispiel #2
0
#! /usr/bin/env python2
"""Minimal example for plotting a YODA histogram using heppyplotlib."""
import matplotlib.pyplot as plt
import heppyplotlib as hpl

hpl.plot("Analysis.yoda", "/ANALYSIS/OBSERVABLE")
plt.savefig('plot.pdf')
Beispiel #3
0
import sys

import heppyplotlib as hpl

if not len(sys.argv) == 3:
    print("usage: {} analysis.yoda /ANALYSIS/HISTOGRAM".format(sys.argv[0]))
    sys.exit(1)

hpl.plot(sys.argv[1], sys.argv[2])
Beispiel #4
0
#! /usr/bin/env python2
"""Example for plotting a YODA histogram using heppyplotlib."""
import matplotlib.pyplot as plt
import heppyplotlib as hpl

# you can disable the usage of Rivet plot info
# also histogram errors might be omitted
hpl.plot("Analysis.yoda",
         "/ANALYSIS/OBSERVABLE",
         uses_rivet_plot_info=False,
         errors_enabled=False)

# hpl.plot calls plt.plot in the end, so you can use normal pyplot commands to customize
plt.xlabel(r'$p_T$')
plt.yscale('log')

plt.show()
plt.savefig('plot.pdf')
#! /usr/bin/env python2
"""Example for plotting more than one YODA histogram using heppyplotlib."""
import matplotlib.pyplot as plt
import heppyplotlib as hpl

hpl.plot("Analysis.yoda", "/ANALYSIS/OBSERVABLE")
hpl.plot("Other_Analysis.yoda", "/OTHER/PATH")
plt.savefig('plot.pdf')

hpl.plot("Other_Analysis.yoda", "/SOME/PATH")
hpl.plot("Another_Analysis.yoda", "/ANOTHER/PATH")
hpl.plot("Yet_Another_Analysis.yoda", "/YET_ANOTHER/PATH")
plt.savefig('other_plot.pdf')