Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Scientific colour maps (fabiocrameri.ch)
67 points by legrande on June 15, 2023 | hide | past | favorite | 22 comments


Mentioned in the text is IBM, which did research back in the 90s on perceptually-based colormaps and how to best represent various types of data within the color dimensions of luminescence, saturation and hue [1]. For example, they found that,

(1) Hue was not a good dimension for encoding magnitude information, i.e. rainbow color maps are bad.

(2) The mechanisms in human vision responsible for high spatial frequency information processing are luminance channels. If the data to be represented have high spatial frequency, use a color map which has a strong luminance variation across the data range.

(3) For interval and ratio data, both luminance- and saturation-varying color maps should produce the effect of having equal steps in data value correspond to equal perceptual steps, but the first will be most effective for high spatial frequency data variations and the second will be most effective for low spatial frequency variations.

===

[1] the original link got removed from IBMs website. Back in the day it was under

https://www.research.ibm.com/people/l/lloydt/color/color.HTM

A pdf copy is here:

https://github.com/frankMilde/interesting-reads/blob/master/...


I've tried using these before and it always progresses as follows:

> Why are you using such ugly colors? This is weird, just use a rainbow plot, everyone knows what a rainbow plot is. We're not approving these reports until you change it to a rainbow plot.

About 90% of the time rainbow plots just encode "blue=no problem; red=problem; everything else=kinda interesting" so it works out fine anyway.

Sometimes I can sneak a red/blue gradient through, but its rare.


Can you give more context? What industry/department are you in and what kinds of reports?

My general experience has been the opposite -- is that anytime you can produce something that feels more elegant or "design"-y, with well-chosen tasteful colors instead of ugly primary colors, that it's extremely well received, and the problem is that coworkers ask me to improve their own charts/presentations which I'm not going to do (but I will send them links to a site like this). But this is in the context of presentations at tech companies.


Physics simulations - Structural/FEA and Fluid Flow/CFD. I've bounced through aerospace, transportation, and medical over the years and its pretty much been the same everywhere.

Management/stakeholders are used to rainbow plots, and haven't had much appetite for anything else (unless the software doesn't give the option).


If you really can’t get away with a perceptually uniform colormap, have you tried turbo [0] before? It’s a rainbow colormap that tries really hard to have a smooth lightness curve

0: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-col...


I tend to think the continuous color palettes don't look very nice (no matter what the colors are) in various data visualizations. So I often prefer the color brewer discrete smaller sets, https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3

I use the viridis inferno on occasion as well, https://github.com/sjmgarnier/viridis, although sometimes it is too dark.



On this note, is anyone aware of any two-dimensional colourmaps that are perceptually-uniform (or close to it), or perhaps periodic?

I find I often have to hand-roll these myself.


They claim that "[t]he colour gradients are perceptually uniform and ordered to represent data both fairly, without visual distortion, and intuitively", however on my calibrated screen many gradients are visibly biased with non-uniform gradients, especially near the darker end. Most noticeable examples include "batlowK", "lipari", "navia" and even "grayC" which is a grayscale gradient.

edit: missed a part of the quote





The one they call Batlow seems quite similar to the color scheme Matplotlib calls Cubehelix. I quite like it, particularly reversed (cubehelix_r); it goes to white near zero, which is nice when plotting sparse data, is sequential (which is of course table-stakes for accessibility/black and white printing reasons), but the different colors make it easy eyeball “tiny/medium/huge” points.


Cubehelix is not a matplotlib colour map, though it is available in their defaults :)

https://www.mrao.cam.ac.uk/~dag/CUBEHELIX/


Ah, interesting to see where it came from (and the name now makes a lot more sense).


what a coincidence, just been going thrubour grafana dashboards and setting heatmaps to at least perceptually uniform colour maps. this is great


> perceptually uniform colour maps

Thank you, googling this led me to the following, which thankfully has quick-loading images as examples (as opposed to the janky OP link)

https://colorcet.com/


on my way out the door... Can these be used in R?


The web design is awful, since they shove this information nearly a full screen below the fold on desktop (below a bunch of corporate logos??), and several screens down on mobile, but yes:

>Built for (almost) everything

>MatLab, Python, Julia, R, GMT, QGIS, Ncview, Ferret, Plotly, Paraview, VisIt, Mathematica, Gnuplot, Surfer, d3, SKUA-GOCAD, Petrel, XMapTools, COMSOL Multiphysics, Fledermaus, Qimera, ImageJ, Fiji, Kingdom, Originlab, GIMP, Inkscape, Adobe Photoshop, and more...


Unfortunately the gnuplot palettes are broken (but easy to fix).



No




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: