Skip to main content

Format numbers as multiples of Pi

Project description

Matplotlib Format Pi

Version Upload Status Downloads
PyPi version Upload Python Package Downloads

Test Upload Python Package

Format multiples of pi as strings on Matplotlib axes.

The MultiplePi class creates a Locator to place ticks at desired multiples and a Formatter to format all tick labels.

The base (π or τ) can be divided by any Natural Number.

Multiples of one-π or one-τ can be placed/formatted too. (2π, 3π, 2τ, 3τ, etc.)

Installing

pip install matplot-fmt-pi

Examples

Simply, the instance can be asssigned a denominator of pi then passed to matplotlib.

Graph Example

The parameters can also be modified to adjust the output to something more sophisticated.

Tau Graph Example

Y-Axis Example

Running Examples

Install then from the repo,

cd examples/
python *.py

Put the repo's directory in the python path to import the matplot_fmt_pi folder not the installed package.

PYTHONPATH=/home/user/py-pros/format-pi python examples/pi_graph.py

Todo

  • Add type stubs

Meta

Inspired by this post on StackOverflow.

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

matplot-fmt-pi-1.6.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

matplot_fmt_pi-1.6.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file matplot-fmt-pi-1.6.3.tar.gz.

File metadata

  • Download URL: matplot-fmt-pi-1.6.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.1 CPython/3.8.5

File hashes

Hashes for matplot-fmt-pi-1.6.3.tar.gz
Algorithm Hash digest
SHA256 fdc403a3ee4deccb632bba7b825b8a44307dd5d6bd8471da27497078a792739e
MD5 abec5f279868477f7ad80cbaaca6b965
BLAKE2b-256 72422175372ce857d4d56315fad93c46bfdc095ba943cc9dca82149f9c726f7d

See more details on using hashes here.

File details

Details for the file matplot_fmt_pi-1.6.3-py3-none-any.whl.

File metadata

  • Download URL: matplot_fmt_pi-1.6.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.1 CPython/3.8.5

File hashes

Hashes for matplot_fmt_pi-1.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9773d2545d7732080bc28c13dad1bd6f2d906f8037a76bdd158ea139c65e27de
MD5 c91fadd4b0f8fc9c156b1695bfa62583
BLAKE2b-256 f0b72a6d616488f8a187bd35caf4a0b463f2e75bc005dd2a88ce75b48eb2dd9a

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