Skip to main content

Huevat

Scientific color palettes and gradients for Matplotlib, Plotly and UltraPlot. Choose colors for categories, continuous fields, or values above and below a center.

Clearer categorical palettes and the four default gradients on light and dark backgrounds

Clearer is the default categorical palette. Use background="dark" for dark figures.

Quick start · Plotting examples · Figure doctor · API guide · Release notes

Recent updates

  • 18 named gradients, including six new choices: Cobalt, Copper, Dusk, Orchid, Tundra and Verdant, each with light and dark versions.
  • Revised Aerosol, Bathymetry and Thermal to distinguish the reported lookalike routes. Earlier versions remain available through their saved recipes and immutable design IDs.
  • Nine colors by default with gradient.discrete(). Diverging and Spectral gradients include the exact neutral as the fifth color. Explicit even counts are supported and omit the midpoint.
  • Named suffixes: _r reverses, _d selects dark, and _d_r or _r_d combines both.

All eighteen named gradients are supported. Numerical screening results and usage guidance are available in the methods documentation. See the release notes and installation and release guide.

Install

Install Huevat from PyPI with your plotting library:

python -m pip install "huevat[matplotlib]"
python -m pip install "huevat[plotly]"
python -m pip install "huevat[ultraplot]"

Requires Python 3.10+. For colors alone, use python -m pip install huevat.

Make a plot

import numpy as np
import matplotlib.pyplot as plt
import huevat as hv
from huevat.adapters import matplotlib as hmpl

xx, yy = np.meshgrid(np.linspace(-3, 3, 160), np.linspace(-2, 2, 100))
field = (8 * np.exp(-((xx - .7)**2 + (yy - .1)**2))
         - 2 * np.exp(-((xx + 1.1)**2 + (yy + .2)**2) / .4))
gradient = hv.diverging()
nine_colors = gradient.discrete()  # default: 9, including the neutral midpoint
boundaries = [-2, -1.5, -1, -.5, -.1, .1, 1, 2, 4, 8]
palette = hv.categorical(5)

fig, axes = plt.subplots(1, 3, figsize=(12, 3.5), layout="constrained")
continuous = axes[0].imshow(field, cmap=hmpl.colormap(gradient), origin="lower",
                            norm=hmpl.normalizer(-2, 8, center=0))
discrete = axes[1].imshow(field, cmap=hmpl.colormap(nine_colors), origin="lower",
                          norm=hmpl.boundary_normalizer(nine_colors, boundaries))
axes[0].set_title("Continuous · zero at neutral")
axes[1].set_title("9 colors · neutral bin around zero")
fig.colorbar(continuous, ax=axes[0], orientation="horizontal")
fig.colorbar(discrete, ax=axes[1], orientation="horizontal")

axes[2].set_prop_cycle(hmpl.cycle(palette, markers=["o", "s", "^", "D", "v"],
                                 linestyles=["-", "--", ":", "-.", "-"]))
x = np.linspace(0, 1, 25)
for i, label in enumerate(["Blue", "Teal", "Ochre", "Coral", "Purple"]):
    axes[2].plot(x, .12 * i + .08 * np.sin(2 * np.pi * x + i / 2),
                 label=label, markevery=4)
axes[2].set_title("Clearer · specified markers and dashes")
axes[2].legend(fontsize=8, loc="upper right")
plt.show()

For a field, pass hmpl.colormap(hv.sequential()) to imshow or pcolormesh. Use hv.diverging() with hmpl.normalizer(vmin, vmax, center=0) for signed data. The discrete example uses nine colors, with zero inside the neutral bin from −0.1 to +0.1. Choose bin boundaries to suit your data.

Continuous signed field, nine-bin diverging field with a neutral center, and categorical lines

See complete examples for all three plotting libraries.

More gradients

Eighteen additional gradients cover general plots, seismic data, terrain, depth, and atmospheric fields, with supported light and dark variants.

The eighteen named gradients on light and dark backgrounds

gradient = hv.gradient("bathymetry")
new_gradient = hv.gradient("verdant")
reversed_gradient = hv.gradient("thermal_r")
dark_gradient = hv.gradient("thermal_d")
dark_reversed_gradient = hv.gradient("thermal_d_r")
print(hv.gradient_names())

The revised routes are:

Gradient Current route Previously similar to
Aerosol Deep red → magenta → pale violet Rosewood
Bathymetry Pale cyan → turquoise → deep ocean, darkening with depth Mineral
Thermal Violet → neutral → green Balance

Append _r to reverse a named gradient or _d to select its dark version; combine them as _d_r or _r_d. gradient.reversed() also changes direction. _d is equivalent to background="dark"; combining it with an explicit background="light" is an error.

For separate colors, gradient.discrete() selects nine bins. Diverging scales include their neutral midpoint; explicit even counts remain available.

signed = hv.diverging()
nine_colors = signed.discrete()  # neutral is nine_colors.colors[4]
assert nine_colors.colors[4] == hv.to_hex(signed.at(0.5))

Check hv.known_counts(gradient) for tested counts. hv.optimized_discrete(gradient, n) searches for better-spaced colors and requires the design extra.

Nine-bin diverging gradients with a visible neutral midpoint

Figure doctor

Coordinate colors, markers and dashes in an existing figure. Repeated labels keep the same style across panels.

Before After
Original figure with similar colors Figure doctor proposal with distinct colors, markers and dashes

Install with python -m pip install "huevat[design,matplotlib]", or replace matplotlib with plotly or ultraplot.

from huevat import doctor

scene = doctor.inspect(fig)
closer, separation, simple = doctor.propose(scene)
preview = doctor.preview(fig, separation)
change = doctor.apply(fig, separation)
change.undo()

Figure doctor guide explains previews, fixed colors and keeping styles across figures. Review the result at the size you intend to use.

Save colors

hv.export(palette).write("palette.json")
restored = hv.load_export(open("palette.json", encoding="utf-8").read()).design
hv.export(hv.diverging(), n=7, format="csv").write("colors.csv")

JSON saves a design for reuse. CSV and hex give you color lists; CSS is also available. See the quick start for labels and more examples.

Metadata

Release files for huevat 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for huevat 0.1.0
File Size Uploaded Provenance Actions
huevat-0.1.0.tar.gz 2.1 MB With provenance Details for huevat-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for huevat 0.1.0
File Interpreter ABI Platform Actions
huevat-0.1.0-py3-none-any.whl Python 3 none any Details for huevat-0.1.0-py3-none-any.whl

Total release size: 4.0 MB

Release files / huevat-0.1.0.tar.gz

Download URL huevat-0.1.0.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
2008f3cbb26461b1b98160db28318365c63c75bef5ea55cab0cca07c64438fd3
BLAKE2b-256 checksum
How to use checksums
229a170e9df7fc4777704e5e5bdb77981f77be0fb30fbd48499f16ea78183462
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / huevat-0.1.0-py3-none-any.whl

Download URL huevat-0.1.0-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6b81403bea8ad5114c4a818d1ea1e5a6cd06b6a1bfba11decf02a42b4cdf0e09
BLAKE2b-256 checksum
How to use checksums
3a1684799d9e0d4dc3eddcf1f7e61f9a5b6def8ebfca057040be818746f0d4cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for huevat 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for huevat-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page