Skip to main content

ATLAS Plots for Humans

Project description


ATLAS Plots
ATLAS Plots

License Documentation Status PyPI - Python Version

ATLAS Plots provides a simple interface to produce plots in ROOT following the standard ATLAS style guidelines. It uses matplotlib-like syntax and idioms while still giving access to the underlying ROOT objects.

Behold, the simplicity of ATLAS Plots:

import atlasplots as aplt

aplt.set_atlas_style()

fig, ax = aplt.subplots(1, 1)
ax.set_xlabel("X [GeV]")
ax.set_ylabel("Events")
ax.set_xlim(0, 100)
ax.set_ylim(0, 10)

fig.savefig("figure.png")

Figure

Compare with the equivalent PyROOT code:

import ROOT
import atlasplots as aplt

aplt.set_atlas_style()

canv = ROOT.TCanvas("canv", "", 800, 600)
frame = ROOT.TH1F("frame", "", 1, 0, 1)
frame.GetXaxis().SetTitle("X [GeV]")
frame.GetYaxis().SetTitle("Events")
frame.GetXaxis().SetLimits(0, 100)
frame.GetYaxis().SetLimits(0, 10)
frame.Draw("AXIS")

canv.SaveAs("figure.png")

Installing

$ pip install atlasplots

You can also install in editable mode if you need a quick-and-dirty way to make changes to the source code:

$ git clone <project-url>
$ cd atlas-plots
$ pip install [--user] -e .

Examples

For those who learn by example

Several examples of more complex plots, such as histogram fits, ratio and fit-residual panels, Data/MC plots, etc., are available under the examples/ directory.

Documentation

The ATLAS Plots documentation is available at https://atlas-plots.readthedocs.io.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atlasplots-0.1.9.tar.gz (21.9 kB view hashes)

Uploaded Source

Built Distribution

atlasplots-0.1.9-py3-none-any.whl (24.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page