1
$\begingroup$

I'm making a map which displays score results for river reaches. The score results are integers from 1 to 7.

Now I want to make a legend and color code my results. However, I don't want to use too many color shades as the human eye/brain is not really able to distinguish clearly between more than +/- 5 shades.

So my question is: how do I divide my 7 (non-continuous) score results into 5 categories for my legend?

I thought of the following options:

legend 1:

  • result = 1 - 2
  • result = 3
  • result = 4
  • result = 5
  • result = 6 - 7

legend 2:

  • result <= 1.4

  • 1.4 < result <= 2.8

  • 2.8 < result <= 4.2

  • 4.2 < result <= 5.6

  • result > 5.6

My issue with the first legend is that I would be visually tricking my audience into thinking that the extreme values are more prevalent than they actually are. My issue with the second legend is that my result values are not continuous, so in reality the second legend looks like this:

  • result = 1

  • result = 2

  • result = 3 - 4

  • result = 5

  • result = 6 - 7

So again, my data will be visually skewed and deceiving my audience.

What are proper ways to handle this type of situation? Or any similar situation for that matter (for instance for 9 or 11 or 13 result values)?

Thanks!

$\endgroup$
1
$\begingroup$

You do not have to use shades of the same colour. You can keep 7 colours if they have sufficient contrast between them.

The "Gradient" and "Indexed" colour schemes of ColorData may be be used to select the 7 colours.

Some examples include.

In Wolfram Language

BarLegend[{#, {0, 7}}, Range@7,
    LegendLabel -> #,
    LegendLayout -> "Row"] & /@
  {"BrightBands", "DarkBands", "Rainbow", "LightTemperatureMap", "TemperatureMap", "ThermometerColors"} //
 Multicolumn[#, 3] &

Mathematica graphics

BarLegend[{#, {0, 7}}, Range@7,
    LegendLabel -> Last@ColorData[#, "AlternateNames"] <> " (" <> ToString@# <> ")",
    LegendLayout -> "Row"] & /@
  {96, 109, 110, 111} //
 Multicolumn[#, 2] &

Mathematica graphics

The ColorFunctionScaling and ColorFunction options will need to be set to use the scheme.

BarChart[Range@7,
 ColorFunctionScaling -> False,
 ColorFunction -> ColorData[{"TemperatureMap", {0, 7}}]
 ]

Mathematica graphics

For a large number of discrete values a "Gradient" colour scheme can be used without restricting the number of contours.

For example

Plot[x, {x, 0, 41},
    ColorFunctionScaling -> False,
    ColorFunction -> ColorData[{#, {0, 41}}],
    PlotLabel -> #,
    Filling -> Axis,
    PlotLegends -> Automatic,
    ImageSize -> Medium
    ] & /@ {"TemperatureMap", "ThermometerColors"} //
 Column

Mathematica graphics

Hope this helps.

$\endgroup$
2
  • $\begingroup$ That is very helpful! And how would you handle a situation where there's a large number of result values which are not divisible by any number? Like for instance 41 values? Or would unequal binning be justified at such large range of values? $\endgroup$ – Anne de Graaf Jun 11 '19 at 22:45
  • $\begingroup$ @AnnedeGraaf See update. $\endgroup$ – Edmund Jun 11 '19 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.