Skip to main content

cvdmaps

Colorblind-safe colormaps and color cycles for matplotlib. matplotlib's default color cycle (tab10) is not colorblind-safe — cvdmaps fixes that in one call, and every palette it ships is verified safe under protanopia, deuteranopia, and tritanopia.

pip install cvdmaps
import cvdmaps
cvdmaps.set_cycle()                 # every plot from here uses a colorblind-safe cycle

import matplotlib.pyplot as plt
plt.plot(x, y1); plt.plot(x, y2)    # colors now stay distinct for colorblind viewers

cvdmaps.palette("okabe_ito")        # ['#000000', '#E69F00', '#56B4E9', ...]
plt.imshow(data, cmap="okabe_ito_nb")   # registered colormaps, usable by name

API

  • set_cycle(name="okabe_ito_nb") — set matplotlib's default color cycle to a colorblind-safe palette. The one call that makes all your plots safe.
  • palette(name="okabe_ito", n=None) — the palette as a list of hex colors (optionally first n).
  • register() — (re)register the colormaps with matplotlib; runs automatically on import.
  • names()['okabe_ito', 'okabe_ito_nb'].

okabe_ito is the 8-color set (incl. black); okabe_ito_nb drops black for line plots on white.

Why trust it

The palettes are the Okabe–Ito colorblind-safe set, and each one passes the OpticQuiz cvdsafe check — the same Machado 2009 + CIEDE2000 engine behind the rest of the suite. Nothing ships that our own checker rejects. For a sequential colorblind-safe map, matplotlib's built-in cividis is a good default.

Licence

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvdmaps-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cvdmaps-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file cvdmaps-0.1.0.tar.gz.

File metadata

  • Download URL: cvdmaps-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cvdmaps-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef33f595bf3bbbfac70ea1a648397895d4a94678ee4596bd1397e2cab111a821
MD5 177314971b0434f5cc5de9d3745074bd
BLAKE2b-256 eeb428647c38a48e7a2437dc768fb67c0fb3570c65fb1e4fa5428bb798482f18

See more details on using hashes here.

File details

Details for the file cvdmaps-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cvdmaps-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cvdmaps-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ace8afbd0f4b5ff7ad319cdc7a7c42df8c626fe16f34b49af2125421ca507ed
MD5 2b2acb1505e98f6bd1c393961215a3a9
BLAKE2b-256 a7319c2a112d522e14d720ed03a1f18476fb1e349f656e3a3d2ac0df484b4924

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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