DColor is a Python 3 module for visualizing complex-valued functions using a Domain Coloring scheme.
DColor leverages two well-known Python libraries: NumPy and Matplotlib.
Before being able to use DColor, you must install these using the following commands:
python3 -m pip install -U numpy
python3 -m pip install -U matplotlib
git clone https://github.com/hernanat/dcolor.git
For development, first, install poetry.
Typically, this involves installing pipx
followed by pipx install poetry
.
Arch-based systems can also install the python-poetry
package.
Clone the repository and run poetry install
.
This will install the project and its requirements to a clean virtual environment which can be accessed through poetry shell
.
git clone https://github.com/hernanat/dcolor.git
poetry install
poetry shell
Note that python
commands in this section should be run inside the virtual environment.
python dcolorExample.py
It generates a series of examples. When each image appears clicking the close button starts the next example. Lambda expressions are used to define and pass functions to the plot() function. The last example is:
dc.plot(lambda z : ((z**2-1)*(z-2- 1j)**2)/(z**2 +2+ 2j),
title='((z**2-1)*(z-2- 1j)**2)/(z**2 +2+ 2j)')
Which results in the following plot:
This is like dcolor except that it does not convert the HSV image to RGB
python hsvcolorExample.py
Will create the images. The last image produces:
This is designed to show the magnitude of abs(z). White means big, shades of green means intermediate, and black means small.
python rgbcolorExample.py
Will create the images. The last image produces:
Currently, this is a one-person project and so these are still under construction. Contact me by e-mail at [email protected] if you would like to help out with anything.
If you are interested in contributing or have any suggested changes, clone the repo and make a pull request :)