Skip to main content

Plotting tools for complex-valued functions

Project description

cplot

Plotting complex-valued functions.

CircleCI codecov PyPi Version GitHub stars

cplot is an attempt at encoding complex-valued data in colors. The general idea is to map the absolute value to lightness and the complex argument (the "angle") to the chroma of the representing color.

The representation is chosen such that

  • values around 0 are black,
  • values around infinity are white,
  • values around +1 are green,
  • values around -1 are red,
  • values around +i are blue, and
  • values around -i are yellow.

See below for examples with some well-known functions.

import cplot
import numpy

cplot.show(numpy.tan, -5, +5, -5, +5, 100, 100)

# There is a tripcolor function as well for triangulated 2D domains
# cplot.tripcolor(triang, z)

| | :-------------------:|:------------------:|:----------:| z**1 | z**2 | z**3 |

| | :-------------------:|:------------------:|:-------------------:| 1/z | (z+1) / (z-1) | (z-1) / (z+1) |

| | :-------------------:|:------------------:|:-------------------------:| numpy.sin | numpy.cos | numpy.tan |

| | :-------------------:|:------------------:|:-------------------------:| numpy.exp | numpy.log | scipy.special.gamma |

Testing

To run the cplot unit tests, check out this repository and type

pytest

Distribution

To create a new release

  1. bump the __version__ number,

  2. tag and upload to PyPi:

    make publish
    

License

cplot is published under the MIT license.

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

cplot-0.1.0.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

cplot-0.1.0-py2.py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 2 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