0

I am producing a series of colour-coded plots in R. Using the ggplot2 command scale_fill_gradientn(name="Intensity", colours=rainbow(5, start = 0.5, end = 0)) produces the following examples:

Figure 1 Figure 1 Figure 2 Figure 2

The problem with this is that Figure 1 has a much higher range of 'Intensity' values than Figure 2. As a result, red on Figure 2 represents a much lower Intensity value than red on Figure 1. I'd like to standardise the scale so that red and blue are at the same points for each graph. Although this will make the differences in Figure 2 harder to visualise, this is what I'm aiming for.

Is there some way of modifying scale_fill_gradientn so that I can specify at which values different colours should be assigned?

CaptainProg
  • 5,610
  • 23
  • 71
  • 116
  • 3
    Possible duplicate of http://stackoverflow.com/questions/22235580/how-to-get-multiple-ggplot2-scale-fill-gradientn-with-same-scaleor [define color gradient for negative and positive values scale\_fill\_gradientn()](http://stackoverflow.com/questions/26926702/define-color-gradient-for-negative-and-positive-values-scale-fill-gradientn) – Roman May 04 '16 at 10:58
  • Agree. This really is identical. Thanks for flagging up; I'm happy to have this question closed. – CaptainProg May 04 '16 at 12:56

0 Answers0