This is a piece of code that uses Python and CERN's PyROOT library to plot data on a graph. It was written during my IT stage at CERN. The produced graphs are like these:
plot1.py | plot2.py |
---|---|
![]() |
![]() |
plot1.py
plots the number of requests received each dayplot2.py
plots the type of requests received by timestampplot3.py
plots the type of requests received by experiment
- Install Python 2.7 on your machine
- Install ROOT library from CERN's official website
- Clone this repo and cd into the src folder
git clone https://github.com/P2-718na/CERN-plots.git cd CERN-plots/src
- Get some data. I couldn't upload the whole dataset i used to make the graphs (400MB), but you
can use
sample.json
andsample-parsed.json
in thesamples
folder to get an idea. - Open a Python console and run the program
python execfile("plot[1|2|3].py")
- If you want to make changes to the graph, re-run
execfile("plot[1|2|3].py")
without closing the Python console (it will be faster, since you won't have to re-read the whole dataset)
- If you are a CERN employee, you can download the
plot1.ipynb
notebook, upload it to CERNbox and run it using SWAN - If you are not a CERN employee, you can still view the notebook using Jupyter notebook viewer