Skip to main content
100%

Matplotlib Colormaps

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 11, 2015

Four examples of perceptually uniform color scales from Matplotlib. The visualization displays the viridis, magma, plasma, and inferno colormaps as horizontal gradient strips on separate Canvas elements. Each strip renders a sequence of hex color values defined in the canvas `data-scale` attribute, and the `<canvas>` elements are styled with a fixed height and a black border. The code uses the canvas API with `width` and `height` attributes to draw the gradient directly, with no external JavaScript libraries, and the color data originates from a static `README` file describing their implementation.

AI-generated description

The mpl colormaps: magma, inferno, plasma and viridis. I previously attempted to implement these in the Cubehelix color space, but the originals are much better. You could presumably plug these colors into a D3 quantize scale, if you were so inclined.

gpl-3.0 Licensed

Similar vizzes