Skip to main content

Units in python strings for matplotlib labels

Project description

https://img.shields.io/badge/version-0.1.0-blue https://img.shields.io/badge/License-MIT-blue

mplunitx is a Python package heavily inspired by the LaTeX package siunitx intended to be used complementary with matplotlib.

matplotlib supports some LaTeX in its text rendering, but not the use of siunitx. Using siunitx is possible with text.usetex=True in the matplotlib rc settings, but this needs a local installation of LaTeX and keeping the fonts consistent is not trivial. mplunitx aims to provide a similar functionality to siunitx by imitating the \num, \unit and \qty commands with python functions, which return strings with LaTeX code that matplotlib understands.

For the labels of the axes, the mplunitx package additionally provides a function for typesetting the variable name and unit with either "/" in between or "[]" around the unit.

Installation

Install with

pip install mplunitx

Usage

See documentation.

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

mplunitx-0.1.0.tar.gz (9.5 kB view hashes)

Uploaded Source

Built Distribution

mplunitx-0.1.0-py3-none-any.whl (10.0 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