Opened 7 years ago

Closed 6 years ago

#3371 closed enhancement (fixed)

Perceptual color tables

Reported by: baharmon Owned by: grass-dev@…
Priority: normal Milestone: 7.6.0
Component: Default Version: svn-trunk
Keywords: r.colors, v.colors, inferno, magma, plasma Cc:
CPU: Unspecified Platform: Unspecified

Description

Add more perceptual color tables like viridis to GRASS. The other perceptual color tables - magma, plasma, and inferno - created by Stéfan van der Walt and Nathaniel Smith for matplotlib would a useful addition.

Furthermore, the r.cpt2grass addon could be integrated into r.colors as an option for importing colors rules from the web.

Attachments (3)

inferno (9.0 KB ) - added by pierreroudier 6 years ago.
"inferno" colour ramp
magma (9.2 KB ) - added by pierreroudier 6 years ago.
"magma" colour ramp
plasma (9.2 KB ) - added by pierreroudier 6 years ago.
"plasma" colour ramp

Download all attachments as: .zip

Change History (10)

comment:1 by martinl, 6 years ago

Milestone: 7.2.4

by pierreroudier, 6 years ago

Attachment: inferno added

"inferno" colour ramp

by pierreroudier, 6 years ago

Attachment: magma added

"magma" colour ramp

by pierreroudier, 6 years ago

Attachment: plasma added

"plasma" colour ramp

comment:2 by pierreroudier, 6 years ago

Agree with the OP, more of these excellent palettes would be great,

I've attached the "inferno", "magma", and "plasma" colour ramps, which can be copied into $GISBASE/etc/colors/

I guess I'd be interested to know if they would be best added to trunk, or moved into a dedicated add-on (I strongly advocate for the first option, since using perceptually uniform palettes is good GIS practice).

comment:3 by wenzeslaus, 6 years ago

Make sense to me. The main reason I did not include these with viridis was that they are so similar to each other (yet different enough to just pick one). Any opinion about that?

For the inclusion into do the source code, please provide a comment similar to what we have for viridis: source:grass/trunk/lib/gis/colors/viridis

Note also that the grass color table is also perceptually uniform (comment:27:ticket:3043).

Finally, if you have further ideas about color tables in GRASS GIS, consider looking into what can be done for version 8 (e.g. #3055).

comment:4 by wenzeslaus, 6 years ago

Keywords: inferno magma plasma added
Milestone: 7.2.47.6.0

comment:5 by pierreroudier, 6 years ago

Those palettes all share the same core characteristics: colorful, perceptually uniform, and robust to colorblindness.

In my view, I like to switch between these depending on the data I am representing -- for example I tend to prefer magma or inferno to viridis to represent say temperature. I've found it useful to have access to those different palettes and adapt to the context -- or sometimes it might just boil down to personal preferences I suppose (how does one use magma and not think of Dr. Evil in Austin Powers??).

More background/illustrations of those palettes: https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html#the-color-scales

Suggested comments:

For inferno:

# perceptually uniform and sequential
# contains black, red and yellow
# color table developed for Matplotlib (default in 2.0)
# license of the original data: CC0
# original authors: Nathaniel J. Smith, Stefan van der Walt, Eric Firing
# created from cpt-city mpl inferno (r.cpt2grass -s)

For magma:

# perceptually uniform and sequential
# contains pale yellow, purple and black
# color table developed for Matplotlib (default in 2.0)
# license of the original data: CC0
# original authors: Nathaniel J. Smith, Stefan van der Walt, Eric Firing
# created from cpt-city mpl inferno (r.cpt2grass -s)

For plasma:

# perceptually uniform and sequential
# contains blue, pink and yellow
# color table developed for Matplotlib (default in 2.0)
# license of the original data: CC0
# original authors: Nathaniel J. Smith, Stefan van der Walt, Eric Firing
# created from cpt-city mpl inferno (r.cpt2grass -s)

comment:6 by neteler, 6 years ago

Any objections to add the attached color files to trunk?

comment:7 by wenzeslaus, 6 years ago

Resolution: fixed
Status: newclosed

In 73190:

add inferno, magma and plasma color tables (closes #3371, thanks to pierreroudier)

Note: See TracTickets for help on using tickets.