Matplotlib for HEP#

m4lep_histogram_6

This training module introduces matplotlib and creates plots commonly used in HEP. It also introduces mplhep, a plotting library designed specifically for HEP plots.

This training module is part of the HSF Software Training Center, a series of training modules that serves HEP newcomers the software skills needed as they enter the field, and in parallel, instill best practices for writing software.

Table of Contents#

Topic

1

Introduction

2

Physics Background

3

Higgs Search

4

Plotting with mplhep for HEP Style Plotting

5

Dimuon Spectrum

You can build this book locally on the command line following these steps:

  1. Install Anaconda

  2. Install Jupyter Book using conda

conda install -c conda-forge jupyter-book
  1. Create a new environment and activate it

conda create --name jupyter_book
conda activate jupyter_book
  1. Clone the repository containing the book source files

git clone git@github.com:amorenobr/matplotlib_for_hep_jb.git
  1. Build your Jupyter Book

jb build --all matplotlib_for_hep_jb
  1. View the Jupyter Book in a browser

google-chrome-stable _build/html/index.html
firefox _build/html/index.html