Skip to main content

ATLAS style for Matplotlib 3.0+

Project description

https://img.shields.io/pypi/v/atlas-mpl-style?label=PyPI&style=for-the-badge:alt:PyPI

Despite the last commit date, this package is still maintained. If you have any comments or improvements, open an issue or PR.

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.

  • A matplotlib style based on the background / foreground from the VIM Paper color scheme, along with a print version with a white background. - The default color cycle in all three styles is generated with HCL Wizard

  • Additional Matplotlib color definitions based on 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 “slides” or “print” style. Fira Sans and Iosevka should be installed for these styles to appear as intended. However, neither is necessary.

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

atlas_mpl_style-0.25.0.tar.gz (150.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atlas_mpl_style-0.25.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file atlas_mpl_style-0.25.0.tar.gz.

File metadata

  • Download URL: atlas_mpl_style-0.25.0.tar.gz
  • Upload date:
  • Size: 150.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for atlas_mpl_style-0.25.0.tar.gz
Algorithm Hash digest
SHA256 0d858ee31901adccb0c635d719e3577e60de88ec08de06b39168fd54a13504f9
MD5 15908b1004028ab926a225c2aaf80241
BLAKE2b-256 1044d8c0960be98bf875cb5ce7bb4d48050dfb221cdbf7b7ee699e992fb8517d

See more details on using hashes here.

File details

Details for the file atlas_mpl_style-0.25.0-py3-none-any.whl.

File metadata

File hashes

Hashes for atlas_mpl_style-0.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7489873b2367f7e520ef27cd331496553c0a0f33bacc236378b86b86c38ec4d
MD5 c6fb0d60807d394aaa13286df0ca64ed
BLAKE2b-256 5caf41f3a5d7b17c8468c1f34011e8c17e722601aee615c24c93efc8c057e52d

See more details on using hashes here.

Supported by

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