xycmap
Bivariate colormap solutions.
This package makes it easy to create custom two-dimensional colormaps, apply them to your series, and add bivariate color legends to your plots.
Installation
pip install xycmap
Usage
Make a custom interpolated colormap by specifying four corner colors (see recognized formats here), and dimensions n:
import xycmap
corner_colors = ("lightgrey", "green", "blue", "red")
n = (5, 5) # x, y
cmap = xycmap.custom_xycmap(corner_colors=corner_colors, n=n)
Or make a colormap by mixing two matplotlib colormaps, and specifying dimensions n:
import matplotlib.pyplot as plt
xcmap = plt.cm.rainbow
ycmap = plt.cm.Greys
n = (5, 5) # x, y
cmap = xycmap.mean_xycmap(xcmap=xcmap, ycmap=ycmap, n=n)
With that in place, apply the colormap to two series that are numeric or categorical:
colors = xycmap.bivariate_color(sx=sx, sy=sy, cmap=cmap)
Note that you can apply limits to the axes, as well as pass custom bins for the axes (if numerical). See the docstring for details.
Then simply pass colors to your plot. To add a legend, create a new ax and run bivariate_legend() into the ax with the same parameters as bivariate_color(), e.g.:
cax = fig.add_axes([1, 0.25, 0.5, 0.5])
cax = xycmap.bivariate_legend(ax=cax, sx=sx, sy=sy, cmap=cmap)
Meta
Remco Bastiaan Jansen – r.b.jansen.uu@gmail.com - https://github.com/rbjansen
Distributed under the MIT license. See LICENSE for more information.
Metadata
Release files for xycmap 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xycmap-1.0.1.tar.gz | 5.1 kB | Without provenance | Details for xycmap-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xycmap-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for xycmap-1.0.1-py3-none-any.whl |
Total release size: 11.1 kB
Release files / xycmap-1.0.1.tar.gz
| Download URL | xycmap-1.0.1.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd8ff0bc0b341fe5e691a12ea3d6fe35af26913912514830e053a9acfa4a5736
|
|
BLAKE2b-256 checksum How to use checksums |
f7d09ec6cd4913a726a19d7a9ff74e679bdad110b037f3f7e5ca5a0309200622
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
|
Release files / xycmap-1.0.1-py3-none-any.whl
| Download URL | xycmap-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
669652bd2049f251d713d73ae18694a4b6ef92f0f9a5c8092fc5bbd1f5fb50b8
|
|
BLAKE2b-256 checksum How to use checksums |
1c6c6bbe66d9e40d8c50552a7df4014f557ae3aa67b990a4fa3f56fd92d07204
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
|
Security for xycmap 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.