[R] a question about taylor.diagram in plotrix package

Jim Lemon jim at bitwrit.com.au
Sat Jan 21 11:01:04 CET 2012


On 01/21/2012 01:08 AM, baydap wrote:
> Hi. I have a question about the taylor.diagram() in plotrix package. How can
> I control the label "correlation"?  In the embedded figure you can see the
> label "correlation" is too close to the ticks. How can I move it and make it
> larger?
> Another problem is the labels "0.95" and "0.99" are too close to the
> plotting area. I do not find any method to control it.
>
> I have been struggling in this problem for a long time. Thanks a lot if
> anyone can help.
> http://r.789695.n4.nabble.com/file/n4313328/taylor.png
>
Hi baydap,
I'm not sure why the labels are coming out so close to the outer 
circumference, it may be your plotting device. I have noticed that text 
size and spacing changes quite a bit between devices. The quickest way 
out is to alter the code a bit. Change these lines:

    text(cos(c(bigtickangles,acos(c(0.95,0.99))))*1.05*maxsd,
     sin(c(bigtickangles,acos(c(0.95,0.99))))*1.05*maxsd,
     c(seq(0.1,0.9,by=0.1),0.95,0.99))
    text(maxsd*0.75,maxsd*0.8,"Correlation")

to:

    text(cos(c(bigtickangles,acos(c(0.95,0.99))))*1.1*maxsd,
     sin(c(bigtickangles,acos(c(0.95,0.99))))*1.05*maxsd,
     c(seq(0.1,0.9,by=0.1),0.95,0.99))
    text(maxsd*0.85,maxsd*0.8,"Correlation")

change the function name to something like taylor.diagram2 and source 
the new function after loading plotrix and before running your code.

Jim



More information about the R-help mailing list