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 details)

Uploaded Source

Built Distribution

mplunitx-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file mplunitx-0.1.0.tar.gz.

File metadata

  • Download URL: mplunitx-0.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for mplunitx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ea1114e4e00d95e638040832ec832f79cbd65e8be06e098d860ffd8cdb744a8
MD5 2b5be208886f93266b7442e81d09c94b
BLAKE2b-256 b71392697c4950277a7a176022c17ba2be8f78885051323bd3a3149973135203

See more details on using hashes here.

File details

Details for the file mplunitx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mplunitx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for mplunitx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 603d4f1fcf4fec75c7c23ee6efa563aaf9a21facbad6463a389e530704c3fbe3
MD5 3e61ea96d9bf1199a4935b435ca14361
BLAKE2b-256 6cc00b7b0e8a2e047a3adb2326a985260dcf59f31c000a522a171a6a31a72fa3

See more details on using hashes here.

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