Skip to content

k-donn/format-pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A class to format numbers as multiples of pi

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages