ATLAS Matplotlib Style
Provides a Matplotlib style replicating that used by the ATLAS collaboration.
Please open an issue if you find this style deviates from the guidelines.
Install from PyPI using pip: pip install atlas-mpl-style
Documentation: https://atlas-mpl.readthedocs.io/en/latest/index.html
In addition, this package also provides:
A function to draw the ATLAS label
- A plot module containing functions to plot pre-binned histograms and
limits. This includes functionality for plotting stacked backgrounds along with data and ratios in the usual ATLAS style.
An additional “Print” (white background) style.
- Additional Matplotlib color definitions based on the ATLAS / Okabe & Ito palette, the Petroff accessible color sequences, the
Paper theme, and the Oceanic Next theme
UHI and the PlottableHistogram protocol
With the development of the UHI interface, this package now has support for histogram objects that follow the PlottableHistogram protocol. plot.Background objects can be constructed using PlottableHistograms and a list of such Backgrounds can be passed to plot.plot_backgrounds omitting the bins argument. The other histogram plotting functions could not be modified to accept PlottableHistogram in a backward compatible manner since they take bins before the histogram argument. Alternate versions of these functions are therefore provided in the uhi module.
As a result of this support, the histogram objects returned by Uproot 4 can be plotted directly, as can Boost-Histogram histograms and Hist objects (once the relevent PRs are merged into those repositories).
usetex=False Mode
usetex=False is now the default, removing the LaTeX dependency.
If you convert a plotting script that uses usetex=True mode, make sure labels are updated to remove LaTeX macros that are not supported by Matplotlib’s mathtext.
TeXLive and Fonts Needed
If you have a full LaTeX installation available, you can use LaTeX to typeset the text by passing usetex=True to use_atlas_style. This will give you much greater options in terms of what can be included in labels.
A working TeXLive installation providing the following is required:
pdflatex
amsmath
TeX Gyre Heros
mathastext
physics (the package)
siunitx
If no LaTeX installation is available, the style will warn and fall back to the usetex=False behaviour. To check if all necessary packages are installed, try building atlas_mpl_style/testing/ampl-test.tex.
On Arch (and related distributions), the texlive-most group is sufficient.
On Debian (Jessie or above) or Ubuntu (18.04+), the following set of packages should be sufficient. It is however highly recommended that you install texlive-full to obtain a complete installation of texlive.
texlive
texlive-latex-extra
texlive-fonts-recommended
texlive-lang-greek
tex-gyre
dvipng
ghostscript
On CentOS 7, the supplied TeXLive (2012) is extremely old. TeXLive should be installed from upstream.
TeXLive is not required for the “print” style. Matplotlib resolves fonts using the following order of preference:
Sans-serif (default): Atkinson Hyperlegible, followed by TeX Gyre Heros, Helvetica Neue, Helvetica, Free Sans, Nimbus Sans L, Arial, and DejaVu Sans.
Monospace: Source Code Pro, Inconsolata, Monaco, Consolas, Ubuntu Mono, DejaVu Sans Mono.
Atkinson Hyperlegible was chosen to ensure text and numbers stay crisp and easy to read from the back of an auditorium, or if plots end up scaled down on a poster or paper.
If you prefer the previous look with Fira Sans, you can select it explicitly after activating the style:
import matplotlib.pyplot as plt
import atlas_mpl_style as ampl
plt.style.use('print')
plt.rcParams['font.sans-serif'] = ['Fira Sans'] + plt.rcParams['font.sans-serif']
Metadata
Release files for atlas-mpl-style 0.27.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| atlas_mpl_style-0.27.0.tar.gz | 37.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| atlas_mpl_style-0.27.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.3 kB
Release files / atlas_mpl_style-0.27.0.tar.gz
| Download URL | atlas_mpl_style-0.27.0.tar.gz |
|---|---|
| Size | 37.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0285a08eb6eaef96d89a739272fe8ff8a66f8bb58ff601488123b7679a6c0e0b
|
|
BLAKE2b-256 checksum How to use checksums |
b1fbb0fbb67a75752b887e571596660f56cc9aa1604eee452ca7f963b66beafa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Release files / atlas_mpl_style-0.27.0-py3-none-any.whl
| Download URL | atlas_mpl_style-0.27.0-py3-none-any.whl |
|---|---|
| Size | 40.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ded23f109efe6853e9099b2eecf819b5c730d109a9b345f7f0d4be7f57ace564
|
|
BLAKE2b-256 checksum How to use checksums |
2cedeb82a1026f108e42498923a73e28731c8fe1bff3ecba464f63bc6983e128
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|