An open API service indexing awesome lists of open source software.

https://github.com/34j/colormap-complex

Complex / 2d multivariate bivariate colormap / Domain coloring for Matplotlib, Plotly etc. (pure-numpy)
https://github.com/34j/colormap-complex

bivariate bivariate-analysis color colormap colour-science complex-analysis complex-numbers domain-coloring domain-colouring matplotlib multivariate multivariate-analysis

Last synced: 12 days ago
JSON representation

Complex / 2d multivariate bivariate colormap / Domain coloring for Matplotlib, Plotly etc. (pure-numpy)

Awesome Lists containing this project

README

        

# Colormap Complex



CI Status


Documentation Status


Test coverage percentage




uv


Ruff


pre-commit




PyPI Version

Supported Python versions
License

---

**Documentation**: https://colormap-complex.readthedocs.io

**Source Code**: https://github.com/34j/colormap-complex

---

Complex / 2d colormap

## Installation

Install this via pip (or your favourite package manager):

```shell
pip install colormap-complex
```

## Usage

```python
from colormap_complex import colormap
import numpy as np

lin = np.linspace(-1, 1, 100)
x, y = np.meshgrid(lin, lin)
z = x + 1j * y
c = colormap(type="oklab")(z.real, z.imag, scale=True)
plt.imshow(c, extent=(-1, 1, -1, 1), origin='lower')
```

### All colormaps

![colormaps](https://raw.githubusercontent.com/34j/colormap-complex/main/colormap-all.jpg)

### Examples

![z^(2/3+i)](https://raw.githubusercontent.com/34j/colormap-complex/main/complex-function-z-2-3-i.jpg)
![z^(2/3+i)](https://raw.githubusercontent.com/34j/colormap-complex/main/complex-function-z-2-3-i-cyl.jpg)
![z^(2/3+i)](https://raw.githubusercontent.com/34j/colormap-complex/main/complex-function-z-2-3-i-cyl-magnitude.jpg)

### Description

- `"bremm", "cubediagonal", "schumann", "steiger", "teulingfig2", "ziegler"` colormaps are collected from [spinthil/pycolormap-2d](https://github.com/spinthil/pycolormap-2d) which is based on:
> M. Steiger, J. Bernard, S. Thum, S. Mittelstädt, M. Hutter, D. A. Keim, and J. Kohlhammer, “Explorative Analysis of 2D Color Maps,” in International Conferences in Central Europe on Computer Graphics, Visualization and Computer Vision, 2015, vol. 23, pp. 151–160.
- Other colormaps are built on top of [colour-science/colour](https://github.com/colour-science/colour) and created by the author.
- `"oklab", "prolab"` are perceptually uniform (lightness) colormaps.
- `"oklch", "prolch"` are perceptually uniform (chroma) colormaps. X axis corresponds to Hue and Y axis to Lightness.

## Alternatives

- [nschloe/cplot: :rainbow: Plot complex functions](https://github.com/nschloe/cplot/tree/main)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Credits

[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)

This package was created with
[Copier](https://copier.readthedocs.io/) and the
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
project template.