[GRASS-dev] [GRASS GIS] #3043: Change default color table

#3043: Change default color table
---------------------------------------+-------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Keywords: r.colors, d.rast, rainbow | CPU: Unspecified
Platform: Unspecified |
---------------------------------------+-------------------------
The default color table in 7.0 is `rainbow`. It is known that it is not
ideal. I think we should change it before the next release.

For example, matplotlib [http://matplotlib.org/style_changes.html changed]
the default to
[http://matplotlib.org/examples/color/colormaps_reference.html viridis].
But there are other options as well.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by mlennert):

Replying to [ticket:3043 wenzeslaus]:
> The default color table in 7.0 is `rainbow`. It is known that it is not
ideal. I think we should change it before the next release.
>
> For example, matplotlib [http://matplotlib.org/style_changes.html
changed] the default to
[http://matplotlib.org/examples/color/colormaps_reference.html viridis].
But there are other options as well.

Choice of color table is one of the most important parts of cartography. I
always tell my students to never use the default colors of any software.
And that even though I don't know why rainbow was chosen, I like it
because it is so blatantly bad that it forces the user to make a
deliberate choice of another color table ;-).

So, I'm not sure I see the need to change that.

If we do change, I think that my favorite candidate for default would then
be grey. This avoids color blindness issues, works for most applications
and at the same time, in our modern color-oriented computing world, does
provoke users to chose another one.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by neteler):

Replying to [comment:1 mlennert]:
> I always tell my students to never use the default colors of any
software.

Agreed - but most users will just take the default (sigh).

> If we do change, I think that my favorite candidate for default would
then be grey. This avoids color blindness issues, works for most
applications and at the same time, in our modern color-oriented computing
world, does provoke users to chose another one.

This might be counter-productive and scare away users ("... oh, it cannot
even show a color map!").

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

In [changeset:"68506" 68506]:
{{{
#!CommitTicketReference repository="" revision="68506"
add viridis color table (see #3043)
}}}

--
Ticket URL: </ticket/3043#comment:3>
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------
Changes (by wenzeslaus):

* Attachment "color_tables.png" added.

comparison of viridis, gray, rainbow and bcyr using elevation from NC
sample dataset

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------
Changes (by wenzeslaus):

* Attachment "color_tables_overview_small.jpg" added.

Overview of different rasters visualized with proposed color tables with
color blidness simulated by ImageMagic

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

`viridis` is now available in trunk (try `r.colors`). This color table was
developed for Matplotlib based on color properties and color perception
and then it won the community voting. See the attachments to see how it
behaves including gray scale print and simulated color blindness (I can
share also the full resolution images).

The number one unresolved thing from my point of view is that `viridis`
has 256 entries (most of the other color tables in GRASS has less than 20)
and some test should be done to see if there is some performance
difference. Also two pairs of colors are actually the same for the same
values. (These issues can be resolved any time later.) Finally, it seems
that on some screens `viridis` starts with more blueish color which
doesn't look that good while on some other with more violet color which
probably the right way (and looks better) but that's more a local issue.

Is anybody opposed to the change of default color table from `rainbow` to
`viridis` in GRASS GIS for release 7.2?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by mlennert):

Replying to [comment:4 wenzeslaus]:
> `viridis` is now available in trunk (try `r.colors`). This color table
was developed for Matplotlib based on color properties and color
perception and then it won the community voting. See the attachments to
see how it behaves including gray scale print and simulated color
blindness (I can share also the full resolution images).

Without some kind of legend, it is difficult to understand what is what in
your color_tables_overview... Generally, it seems to me that rainbow and
bcyr provide greater contrasts.

> Is anybody opposed to the change of default color table from `rainbow`
to `viridis` in GRASS GIS for release 7.2?

I would vote -0, i.e. I'm opposed to this change, but not enough to stop
it if others all agree on it.

I'm not convinced that viridis is better. More so, I think that if we
provide a default color table of which we say that it is good (better than
rainbow), we should make our criteria more explicit. Why do you find
viridis good (better than other color tables) ? Just aesthetics ? What is
good for matplotlib, might not be good for GRASS...

More fundamentally, and to repeat myself: IMHO there is '''no''' good
default color table. Color tables qualities are context and target
dependent. I personally thus prefer not to pretend that we can provide a
good color table by default.

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

Published papers about why rainbow color table is bad (incomplete list):

* D. Borland and R. M. Taylor Ii, "Rainbow Color Map (Still) Considered
Harmful," in IEEE Computer Graphics and Applications, vol. 27, no. 2, pp.
14-17, March-April 2007. doi: 10.1109/MCG.2007.323435
* Stauffer, Reto, et al. "Somewhere over the rainbow: how to make
effective use of colors in meteorological visualizations." Bulletin of the
American Meteorological Society 96.2 (2015): 203-216.
* Rougier, Nicolas P., Michael Droettboom, and Philip E. Bourne. "Ten
simple rules for better figures." PLOS Comput Biol 10.9 (2014): e1003833.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

A search of the Internet yields many websites and blog posts dealing with
rainbow color table and the message seems to be quite clear: avoid using
it. See for example [https://eagereyes.org/basics/rainbow-color-map How
The Rainbow Color Map Misleads].

The issue with having it as a default is that it is a sign of an approval.
Sometimes people even consider rainbow color table appealing which makes
it even more dangerous default because "it is default selected by the
smart software creators and I like it, so let's not change it."

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

Replying to [comment:5 mlennert]:
> Replying to [comment:4 wenzeslaus]:
> > See the attachments to see how it behaves including gray scale print
and simulated color blindness (I can share also the full resolution
images).
>
> Without some kind of legend, it is difficult to understand what is what
in your color_tables_overview...

The legend is in the full size image (shared personally). The layout of
images is the following. First 2x2 images are:

|| viridis || rainbow ||
|| grey || bcyr ||

Next 2x2 to the right are the same with less RGB colors used for
representation (as it happens in videos or GIFs). The next 2x2 to the
right are the 4 original images in gray scale (as if printed on paper; it
also shows how one perceives intensity of that image).

|| normal (2x2) || reduced colors (2x2) || gray scale (2x2) ||

Next two rows are again the original 4 images in 2x2 layout with 3 color
blindness variations simulated by !ImageMagic.

|| protanope (2x2) || deuteranope (2x2) || tritanope (2x2) ||

The same is repeated also for random surface created by r.surf.fractal and
landclass96 categorical raster from the NC dataset (the first row is NC
elevation raster).

|| elevation (4x6) ||
|| fractal (4x6) ||
|| landclass (4x6) ||

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------
Changes (by wenzeslaus):

* Attachment "col_plus_cos_col_viridis_rainbow_bcyr_gray_small.png" added.

Wave tilted surface represented with viridis, rainbow, bcyr and gray color
tables

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3043&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

Replying to [comment:5 mlennert]:
> Generally, it seems to me that rainbow and bcyr provide greater
contrasts.

This might be true is some cases, or at least it seems this way. However,
the opposite is true in the example I just posted which is a slightly
titled plane with waves on it created using:

{{{
g.region cols=500 rows=300 n=-300 s=-600 w=0 e=500
r.mapcalc "x = col() / 10 + 2 * cos(col() * 100)" && r.colors map=x
color=grey
}}}

The waves are visible with `viridis` (first) and `gray` (last) but
`rainbow` (second) shows them a lot in the middle while not at all in the
green region. `bcyr` (third) shows waves on the sides but not so much in
the middle, they seem to be completely lost in light blue and yellow
regions.

[[Image(col_plus_cos_col_viridis_rainbow_bcyr_gray_small.png)]]

See more in work by [http://peterkovesi.com/projects/colourmaps/ Peter
Kovesi] (Colour Maps with Uniform Perceptual Contrast).

In some other cases `rainbow` overly emphasizes features or even creates
(suggests) features which are not there. The example above doesn't show
this except for the region between light and dark blue where the lines
(waves) are much more prominent.

It must be noted that a lot of color tables, even some rainbow-like ones
when they are ''perceptually uniform'', can perform good in this test.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

Replying to [comment:5 mlennert]:
> I think that if we provide a default color table (here ''map'') of which
we say that it is good (better than rainbow), we should make our criteria
more explicit.

Article on Gnuplotting (citing Moreland, 2009) lists these features for a
default color table and I'm adding my notes in the nested lists:

* The map yields images that are aesthetically pleasing
  * Although some people consider `rainbow` pretty or are simply used to
it, my claim is that it is objectively worse because things which contain
less colors or less styles in general is considered a better graphical
design.
  * `grey` is OK but black and white is a bit boring and then there is the
"show color feature" thing Markus mentioned in comment:2
  * In cartography black and white have usually special purpose (like text
and its halo), so this excludes color tables which start or end with one
of them.
  * The black-body radiation color tables which include or are similar to
color tables like `sepia` in GRASS GIS, or `hot`, `inferno`, `plasma`, and
`magma` in Matplotlib are often recommend, but I haven't seen them used
that much. There might a actually a aesthetic reason for it. The Better
Default Colormap for Matplotlib video suggests that the reason is that
these don't have a green color in them. However, in general, I think they
are nice. Gnuplot default is actually similar to `inferno`, `plasma`, or
`magma`.
  * The cubehelix color tables are often regarded as "rotten melon",
although some variations look nice and some are very much like `viridis`,
`plasma`, and others. See seaborn and palettable for examples.
  * `inferno`, `plasma`, `magma`, and `viridis` were considered for
Matplotlib and `viridis` was selected because it was the one most people
liked. As mentioned above, it was likely visual because unlike others, it
had green in (the measurable/theoretical features were similar with the
other three).
* The map has a maximal perceptual resolution
  * In comment:9 showed that our `rainbow` doesn't always have it. Some
revised rainbow-like color tables may have it quite high.
* Interference with the shading of 3D surfaces is minimal
  * This rules out the `grey` and also the ones which go from very low
brightness (black) to very high brightness (white).
* The map is not sensitive to vision deficiencies
  * Although there is many different color blindness variations and
sometimes the percentages of affected people are relatively low, this is
often a requirement and my guess is that, similarly to web design,
everybody at the end benefits.
  * This rules out anything which contains red and green at the same time
like `rainbow` or `gyr`.
  * This also likely rules out anything which does not look good when
converted to gray scale as the intensity is probably the last thing which
is preserved. (I would need to do more here.) However, there is the
benefit of printing in gray scale without much loss.
* The order of the colors should be intuitively the same for all people
  * I guess the usual issue here is who can name colors of rainbow in the
right order? Additionally, does the color table include all colors or does
it skip some?
  * This likely rules out anything with a lot of colors, so probably also
the rainbow-like color tables which fix some of the classic rainbow color
table problems.
  * Simpler color tables with one or two colors like `summer` from
Matplotlib doesn't require any knowledge of order.
  * As the order of colors is not clear even few colors may create
confusion. Exception might black-body radiation color tables where the
order might be intuitive (but that might be just result of the brightness
as discussed in the following point).
  * I think this is also where the diverging color tables like
`differences` or `curvature` fail here as defaults because the choice of
order of individual colors is arbitrary and the often pronounced middle
would be unsuitable. However, !ParaView uses diverging blue-white-red as a
default and there are is some literature which suggests them.
  * Brightness seems to be only generally accepted natural ordering. This
is in favor of `grey` and all color tables which look like grey when
printing in black and white. This is the case for cubehelix color tables
and `inferno`, `plasma`, `magma`, and `viridis`.
* The perceptual interpolation matches the underlying scalars of the map
  * (I would need to do more reading here but) I think that it means that
human should be able to guess what is the color in between two colors in
the color table and the result should be the same as what is a more
detailed color table would actually say. Simple color tables with
predictable changes in brightness would fulfill this.

> Why do you find viridis good (better than other color tables) ?

As far as I can tell, the general trend in default color tables is
simplicity, i.e. one, two or three colors, excluding white and black,
clear brightness increase and black and white printing friendly, and color
blind friendliness. Matplotlib's plasma and viridis fulfill those well
together with some color tables from the cubelix and black-body radiation
families (and perhaps some others designed in some other way but
intentionally or unintentionally fulfilling the criteria - a lot of work
would be needed, however, to find and check those).

> Just aesthetics ?

I think it is the final factor after the other things are fulfilled since
many color tables would fulfill the other requirements, but wouldn't be
nice (some of the cubehelix ones, for example). There are two things which
support viridis as color table accepted by people for aesthetic reasons.
viridis has won voting over inferno, plasma, and magma preceding its
inclusion to Matplotlib and Matlab actually has similar color table to
viridis called parula (and I don't think they would select something they
wouldn't consider nice). viridis' authors actually claim (in the video)
that viridis is little better than parula according to its behavior in
some color space (default of both in the past was jet which is similar to
rainbow); some people actually mention aesthetics as well, but that's
quite subtle difference in case of viridis and parula.

> What is good for matplotlib, might not be good for GRASS...

They actually considered even terrain with shading as a use case. So, the
question should be why it wouldn't be good for GRASS when it is good for
Matplotlib?

> More fundamentally, and to repeat myself: IMHO there is '''no''' good
default color table. Color tables qualities are context and target
dependent. I personally thus prefer not to pretend that we can provide a
good color table by default.

However, people simply use the default anywhere from tutorials to articles
and the reasons range from trusting the defaults (because why would
authors put there bad defaults?) to liking the rainbow color tables (which
are considered bad for several reasons). Thus, I think we need to provide
the best default we can. This doesn't mean that we should not promote
usage of a proper color table for a given case. For example, digital
elevation models, temperatures or water depth are good examples where the
default is not appropriate.

''(I'm not including any links because Trac spam filter won't let me.)''

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:10&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by mlennert):

Replying to [comment:10 wenzeslaus]:
> Replying to [comment:5 mlennert]:
> > I think that if we provide a default color table (here ''map'') of
which we say that it is good (better than rainbow), we should make our
criteria more explicit.
>
> Article on Gnuplotting (citing Moreland, 2009) lists these features for
a default color table and I'm adding my notes in the nested lists:

Wow, you're really putting a lot of research into this. Thanks !

I agree with all you are saying (I never defended rainbow as a good color
table !), and if you all think that having a better (not good, as I don't
think that exists, but better) default color table, then go for it. As
said, if we change, then personally I would prefer grey (as this would
force people to chose if they want color), but I hear what you are saying
about the marketing aspect.

One aspect your review doesn't seem to take into account is categorized
maps. Many of the above arguments only relate to continuous, quantitative
values, not qualitative data (and the landuse map in viridis is not very
nice... ;-)), but I guess this is impossible to detect automatically, so
different defaults for different types of maps does not make sense.

So, for me, go ahead with whatever you feel is right...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3043#comment:11&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

Replying to [comment:11 mlennert]:
> One aspect your review doesn't seem to take into account is categorized
maps. Many of the above arguments only relate to continuous, quantitative
values, not qualitative data (and the landuse map in viridis is not very
nice... ;-)),

Right, I did not address them explicitly and I didn't looked at those
specifically, but most of the things apply to categorical (qualitative) as
well. Also I think that in case of categorical as well as diverging data
(e.g. difference), it is easier for user to realize that a special color
table is needed. viridis is not ideal but would work better than gray I
think.

> but I guess this is impossible to detect automatically, so different
defaults for different types of maps does not make sense.

Well, in the current code, there are in fact separate calls for CELL and
FCELL+DCELL (`Rast_map_is_fp()` is used). So, if we say that CELL map are
categorical, they could be separate. I'm not sure how big assumption that
would be. If CELL==categorical, separate tables would be easy to add
unless I'm missing something.
(source:grass/trunk/lib/raster/color_read.c?rev=68564#L55)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3043#comment:12&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by mlennert):

Replying to [comment:12 wenzeslaus]:
> Replying to [comment:11 mlennert]:
> > One aspect your review doesn't seem to take into account is
categorized maps. Many of the above arguments only relate to continuous,
quantitative values, not qualitative data (and the landuse map in viridis
is not very nice... ;-)),
>
> Right, I did not address them explicitly and I didn't looked at those
specifically, but most of the things apply to categorical (qualitative) as
well. Also I think that in case of categorical as well as diverging data
(e.g. difference), it is easier for user to realize that a special color
table is needed. viridis is not ideal but would work better than gray I
think.

You really do like viridis, it seems :wink:

>
> > but I guess this is impossible to detect automatically, so different
defaults for different types of maps does not make sense.
>
> Well, in the current code, there are in fact separate calls for CELL and
FCELL+DCELL (`Rast_map_is_fp()` is used). So, if we say that CELL map are
categorical, they could be separate. I'm not sure how big assumption that
would be. If CELL==categorical, separate tables would be easy to add
unless I'm missing something.
(source:grass/trunk/lib/raster/color_read.c?rev=68564#L55)

I thought about this. I think there are sufficient quantitative variables
that are integers (just imagine a DEM with 1m vertical precision) to make
this assumption (CELL = categorical) a bit dangerous.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:13&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

Replying to [comment:13 mlennert]:
> You really do like viridis, it seems :wink:

There are alternatives if you go though the related papers and websites,
but viridis seems to me as a really strong candidate. (Anybody please
suggest others!)

Also, another open source community (Matplotlib) already did the hard work
of identifying viridis and its relatives as good candidates for default.

Moreover, I think there is value in choosing what some other open source
project uses.

> I think there are sufficient quantitative variables that are integers
(just imagine a DEM with 1m vertical precision) to make this assumption
(CELL = categorical) a bit dangerous.

This was why I originally rejected the idea. Another good example would be
(most of?) imagery data or count of occurrences (e.g. `r.in.lidar
method=n`). The counter argument would be that the categorical color table
would actually work for them in the same way as rainbow worked so far, but
the actual categorical data would benefit. However, I don't think it is a
string argument.

BTW, it would make sense to track this in the metadata (G7:t.create has
`semantictype=min|max|sum|mean`).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:14&gt;
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

In [changeset:"68586" 68586]:
{{{
#!CommitTicketReference repository="" revision="68586"
change default color table for 2D and 3D rasters (see #3043)

Introduces DEFAULT_COLOR_TABLE define for
an easy change and global control.

Depends on r68506 which includes the
viridis color table used as a new default.

Also removes (obsolete?) calls to the
color table specific function and
uses the general function instead.
}}}

--
Ticket URL: </ticket/3043#comment:15>
GRASS GIS <https://grass.osgeo.org>

#3043: Change default color table
--------------------------+---------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: blocker | Milestone: 7.2.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors, d.rast, rainbow
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------------

Comment (by wenzeslaus):

I made the change in r68586, but note that the commit also makes it easy
to change the color table now - change at one place in include/gis.h:

{{{
#define DEFAULT_COLOR_TABLE "viridis"
}}}

So, we can of course still do that. Of course, I put viridis there for
now.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3043#comment:16&gt;
GRASS GIS <https://grass.osgeo.org>