1

I have not used plotrix before but I am trying to create a taylor diagram to show the SD and RMS errors between reanalysis wind speed data and modelled wind speed projections from RCM RCA4 forced by 5 different GCM.

The script I am using can be seen below (edited: reproducible data now in place). I am not sure what I am doing wrong but as you can see from the attached image multiple points are being plotted for each modelled dataset, rather than a singular point...Taylor diagram test plot

Any advice or guidance on what I am doing wrong and how to correct it would be much appreciated.

Thanks in advance.

library(datasets)
library(ncdf4)
library(plotrix)



data <- volcano

taylor.diagram(volcano,volcano,add=FALSE,col="red",pch=4,pos.cor=TRUE,xlab="MERRA SD (Normalised)",ylab="RCA4 runs SD (normalised)",main="Taylor Diagram",show.gamma=TRUE,ngamma=3,sd.arcs=1,ref.sd=TRUE,grad.corr.lines=c(0.2,0.4,0.6,0.8,0.9),pcex=1,cex.axis=1,normalize=TRUE,mar=c(5,4,6,6),lwd=10,font=5,lty=3)

lpos<-1.5*sd(windMERRA)

legend(1.5,1.5,cex=1.2,pt.cex=1.2,legend=c("volcano"),pch=4,col=c("red"))
  • Please use reproducible data for your example – Hack-R Jul 20 '17 at 14:50
  • Sorry I am very much a beginner in R and am not sure how to do that....maybe a better question for me to ask would be what format my data should be in to input into taylor.diagram function? – Charlie Leaman Jul 20 '17 at 15:08
  • May first timers make that mistake. But with either question, they'll close/downvote your question if you don't provide a MCVE (https://stackoverflow.com/help/mcve). I would just take a little extra time to go find some reproducible data you can use with your question and re-write it. See also: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example It's to help us help you. – Hack-R Jul 20 '17 at 15:18
  • Okay thanks, I will give that a go! – Charlie Leaman Jul 20 '17 at 15:22

1 Answers1

2

The volcano dataset is a matrix. The taylor.diagram() expects a vector of values for ref and model arguments. Using matrices in the function seems to result in more than one point per column of the matrix, but I am not sure exactly what it does. Check the format of your data. If it is in matrices, then you can use as.vector() to convert them into vectors and use these vectors in taylor.diagram() and use 'add=TRUE' after plotting the first dataset. The example for a single point with volcano is given below..

enter image description here

library(datasets)
library(ncdf4)
library(plotrix)

taylor.diagram(as.vector(volcano), # makes a vector
               as.vector(volcano), # makes a vector
               add=FALSE,
               col="red",
               pch=4,
               pos.cor=TRUE,
               xlab="MERRA SD (Normalised)",
               ylab="RCA4 runs SD (normalised)",
               main="Taylor Diagram",
               show.gamma=TRUE,
               ngamma=3,
               sd.arcs=1,
               ref.sd=TRUE,
               grad.corr.lines=c(0.2,0.4,0.6,0.8,0.9),
               pcex=1,cex.axis=1,
               normalize=TRUE,
               mar=c(5,4,6,6),
               lwd=10,
               font=5,
               lty=3)

taylor.diagram(as.vector(volcano),
               as.vector(volcano),
               add=FALSE,
               col="red",
               pch=4,
               pos.cor=TRUE,
               xlab="MERRA SD (Normalised)",
               ylab="RCA4 runs SD (normalised)",
               main="Taylor Diagram",
               show.gamma=TRUE,
               ngamma=3,
               sd.arcs=1,
               ref.sd=TRUE,
               grad.corr.lines=c(0.2,0.4,0.6,0.8,0.9),
               pcex=1,cex.axis=1,
               normalize=TRUE,
               mar=c(5,4,6,6),
               lwd=10,
               font=5,
               lty=3)

legend(1.5,1.5,cex=1.2,pt.cex=1.2,legend=c("volcano"),pch=4,col=c("red"))
Calvin
  • 1,309
  • 1
  • 14
  • 25