cblind

Colorblind friendly colormaps and color cycles for matplotlib

https://github.com/la-niche/cblind

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.0%) to scientific vocabulary

Keywords

color-scheme matplotlib python visualization
Last synced: 4 months ago · JSON representation ·

Repository

Colorblind friendly colormaps and color cycles for matplotlib

Basic Info
  • Host: GitHub
  • Owner: la-niche
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 1.01 MB
Statistics
  • Stars: 21
  • Watchers: 1
  • Forks: 2
  • Open Issues: 2
  • Releases: 5
Topics
color-scheme matplotlib python visualization
Created about 7 years ago · Last pushed 4 months ago
Metadata Files
Readme License Citation

README.md

cblind

PyPI Supported Python Versions Documentation Status uv

A colorblind-friendly python module that allows color choice for plotting multiple curves 8 colormaps are now available to map 2D fields Authors: Gaylor Wafflard-Fernandez, Clément Robert Author-email: gaylor.wafflard@univ-grenoble-alpes.fr

Installation

Install with pip

pip install cblind

To import cblind:

python import cblind as cb

Usage for plotting

10 palette functions to plot curves are available for now in the Colorplots class, with the corresponding test plotting functions.

cblind

python color, linestyle = cb.Colorplots().cblind(nb_of_plots)

from 1 to 12 plots [DISTINCT COLORS]. For more than 12 plots, the linestyle is changed.

python cb.test_cblind(nb_of_plots)

cblind

contrast

python color, linestyle = cb.Colorplots().contrast(nb_of_plots)

for less than 4 contrast plots [DISTINCT COLORS]. For more than 12 plots, the linestyle is changed.

python cb.test_contrast(nb_of_plots)

contrast

huescale

python color, linestyle = cb.Colorplots().huescale(nb_of_plots, *option)

from 1 to 9 plots [SEQUENTIAL DATA]. With option "blue","bluegreen","green", "gold","brown","rose","purple" for less than 3 plots, otherwise ocherscale.

python cb.test_huescale(nb_of_plots, *option)

huescale

rbscale

python color, linestyle = cb.Colorplots().rbscale(nb_of_plots)

from 3 to 11 plots [DIVERGING DATA].

python cb.test_rbscale(nb_of_plots)

rbscale

rainbow

python color, linestyle = cb.Colorplots().rainbow(nb_of_plots)

from 4 to 12 plots [RAINBOW SCHEME].

python cb.test_rainbow(nb_of_plots)

rainbow

extreme_rainbow

python color, linestyle = cb.Colorplots().extreme_rainbow(nb_of_plots)

from 1 to 34 plots [RAINBOW SCHEME].

python cb.test_extreme_rainbow(nb_of_plots)

extreme_rainbow

solstice

python color, linestyle = cb.Colorplots().solstice(nb_of_plots)

for less than 11 plots [DIVERGING DATA]

python cb.test_solstice(nb_of_plots)

solstice

bird

python color, linestyle = cb.Colorplots().bird(nb_of_plots)

for less than 9 plots [DIVERGING DATA]

python cb.test_bird(nb_of_plots)

bird

pregunta

python color, linestyle = cb.Colorplots().pregunta(nb_of_plots)

for less than 9 plots [DIVERGING DATA]

python cb.test_pregunta(nb_of_plots)

pregunta

monocolor

python color, linestyle = cb.Colorplots().monocolor(nb_of_plots, *option)

from 1 to 13 monochromatic plots [MONOCOLOR/PRINTING] with different linestyles. With option "b&w", "blue", "red", "yellow", "green", "purple".

python cb.test_monocolor(nb_of_plots, *option)

monocolor

Usage for colormaps

8 cblind palettes are available for now : "cb.rbscale", "cb.rainbow", "cb.extreme_rainbow", "cb.huescale", "cb.solstice", "cb.bird", "cb.pregunta", "cb.iris", but also all colormaps from matplotlib + "_r" variants for reverse colormaps.

python cmap = cb.cbmap(palette, nbin)

The nbin argument is used to discretize the colormaps.

colormaps

To test the colormaps, you can try:

python cb.test_mapping(palette, nbin)

Example with a field data2d

```python import numpy as np import matplotlib.pyplot as plt data2d = np.repeat(np.linspace(0,1,100),20).reshape(100,20).T

fig, ax = plt.subplots() im = ax.imshow(data2d, cmap=cb.cbmap("cb.rainbow_r", nbin=10), aspect='auto') fig.colorbar(im) plt.show() ```

Basic mapping function

python cb.mapping(fig,ax,data2d,extent,palette=palette,nbin=nbin)

REFERENCE Paul Tol. 2012. "Colour Schemes." SRON Technical Note, SRON/EPS/TN/09-002. https://personal.sron.nl/~pault/data/colourschemes.pdf

Owner

  • Name: la niche
  • Login: la-niche
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Wafflard-Fernandez"
  given-names: "Gaylor"
  orcid: "https://orcid.org/0000-0002-3468-9577"
- family-names: "Robert"
  given-names: "Clément"
  orcid: "https://orcid.org/0000-0001-8629-7068"
title: "cblind"
version: 2.3.2 # when bumping this, remember to also update date-released
date-released: 2025-09-03
url: "https://github.com/la-niche/cblind"

GitHub Events

Total
  • Issues event: 1
  • Watch event: 1
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 12
  • Pull request review event: 1
  • Pull request event: 37
  • Fork event: 1
  • Create event: 10
Last Year
  • Issues event: 1
  • Watch event: 1
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 12
  • Pull request review event: 1
  • Pull request event: 37
  • Fork event: 1
  • Create event: 10

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 91
  • Total Committers: 4
  • Avg Commits per committer: 22.75
  • Development Distribution Score (DDS): 0.593
Past Year
  • Commits: 18
  • Committers: 2
  • Avg Commits per committer: 9.0
  • Development Distribution Score (DDS): 0.056
Top Committers
Name Email Commits
volodia99 y****9@g****m 37
Clément Robert c****2@p****m 31
volodia99 g****d@i****u 22
gwf g****f@z****. 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 1
  • Total pull requests: 58
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Total issue authors: 1
  • Total pull request authors: 5
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.07
  • Merged pull requests: 45
  • Bot issues: 1
  • Bot pull requests: 17
Past Year
  • Issues: 1
  • Pull requests: 58
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Issue authors: 1
  • Pull request authors: 5
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.07
  • Merged pull requests: 45
  • Bot issues: 1
  • Bot pull requests: 17
Top Authors
Issue Authors
  • renovate[bot] (1)
Pull Request Authors
  • neutrinoceros (39)
  • renovate[bot] (11)
  • dependabot[bot] (4)
  • pre-commit-ci[bot] (2)
  • volodia99 (2)
Top Labels
Issue Labels
Pull Request Labels
dependencies (16) github_actions (4)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 464 last-month
  • Total dependent packages: 3
  • Total dependent repositories: 1
  • Total versions: 10
  • Total maintainers: 1
pypi.org: cblind

Colorblind friendly colormaps and color cycles for matplotlib

  • Versions: 10
  • Dependent Packages: 3
  • Dependent Repositories: 1
  • Downloads: 464 Last month
Rankings
Dependent packages count: 2.3%
Downloads: 10.1%
Average: 13.9%
Stargazers count: 16.0%
Forks count: 19.2%
Dependent repos count: 21.9%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • cycler >=0.10
  • matplotlib >=3.5
  • numpy >=1.17
requirements/tests.txt pypi
  • pytest >=6.1 test