0

I have a biological index called TSI (trophic status index) that I'd like to represent visually (using R). I'd like to do this using a bar that transitions from blue to green with the value mapped on the bar. This image that I found online (Minnesota DNR Lakefinder website) is what I'm going for:

enter image description here

How should I go about this?? I'm not sure where to start.

snalven
  • 411
  • 1
  • 6
  • 12
  • The color bars can just be heat maps built with the `image` function. Then the arrow can be added using `rasterImage`. E.g. https://stackoverflow.com/questions/27800307/adding-a-picture-to-plot-in-r – thc Nov 16 '17 at 19:56
  • It would be easier to help you if you provided a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data that can be used to test possible solutions. – MrFlick Nov 16 '17 at 20:22
  • A quck and dirty solution: use `viridis` (or other packages) to get the desired palette. Plot dummy values using this palette and then overlay a large triangle in red with your data. Also see https://stackoverflow.com/questions/13221830/how-can-i-fill-the-background-with-a-color-scale-in-function-of-a-lineal-model. – Gautam Nov 16 '17 at 20:36

0 Answers0