1

I am working on simulating LST and comparing it with MODIS data. For comparison of different simulations I want to use a Taylor diagram. I am able to make basic Taylor diagrams for different simulations using plotrix in R. However, is there a way to include bias in the diagram? I attempted the following; Adding bias in Taylor diagram in R. However my figure apppears like

Figure 1

I am relatively new to R, so it would be great if some one could help me on this.

Also, while doing some search I came across another way of representing bias as in

Figure 2

Is it possible in plotrix to plot a taylor diagram with bias like this? I find this option better as I have more than one model to be compared, and if I plot vectors and lines for each bias the plot will become cluttered.

Community
  • 1
  • 1
rar
  • 894
  • 1
  • 9
  • 24

1 Answers1

2

One method of creating a plot with the bias as a color is illustrated in the following code. The bias must be calculated for each model (arbitrary values are assigned in the code). After this, a color palette for the bias can be created, and then a color assigned to each point (model) based on the color bin of the bias for that model. The points (models) can be plotted individually using the specific color for that model. The color bar for the bias can be added at the end.

enter image description here

library(plotrix) # for taylor diagram
library(RColorBrewer) # for color palette

# setting random number generator
set.seed(10)

# fake some reference data
ref<-rnorm(30,sd=2)

model1<-ref+rnorm(30)/2 # add a little noise for model1
model2<-ref+rnorm(30) # add more noise for model2
model3<-ref+rnorm(30)*1.1 # add more noise for model3
model4<-ref+rnorm(30)*1.5 # add more noise for model4

# making up bias values for each model
bias1 <- 0.5
bias2 <- -1
bias3 <- 0.9
bias4 <- -0.25

# making color values
num_cols <- 8 # number of colors for bias
cols <- brewer.pal(num_cols,'RdYlGn') # making color palette, many other palettes are available

# making vector of color breaks
# breaks define the regions for each color
min_bias <- -1 # minimum bias
max_bias <- 1 # maximum bias
col_breaks <- seq(min_bias,max_bias,(max_bias - min_bias)/(num_cols))

# assigning colors based on bias
# color index assigned based on the value of the bias
col1 <- cols[max(which( col_breaks <= bias1))]
col2 <- cols[max(which( col_breaks <= bias2))]
col3 <- cols[max(which( col_breaks <= bias3))]
col4 <- cols[max(which( col_breaks <= bias4))]

# display the diagram and add points for each model
# use color assigned for each model for that model's point
taylor.diagram(ref,model1,col=col1)
taylor.diagram(ref,model2,col=col2,add=T)
taylor.diagram(ref,model3,col=col3,add=T)
taylor.diagram(ref,model4,col=col4,add=T)

# adding color bar
color.legend(3.5,0,4,2 # coordinates
             ,(col_breaks[1:(length(col_breaks)-1)]+col_breaks[2:length(col_breaks)])/2 # legend values (mean of color value)
             ,rect.col=cols # colors
             ,gradient='y' # vertical gradient
             )
Calvin
  • 1,309
  • 1
  • 14
  • 25