Message Boards Message Boards

Plotting Taylor diagrams?

Hello everyone, I am a researcher in water engineering and are now using Mathematica to help in my research. I tried to plot Taylor diagram in Mathematica for my data. So I calculated the Correlation Coefficient, Root Mean Square Error, Standard Deviation and the Centered RMS difference for the data.(Please see the attached notebook file). But in the last stage, I couldn't plot the diagram similar to the sample image of Taylor diagrams!

Could you please let me know, How I can do it ? Or which command is need for plotting this diagram?

Thanks for your helps.

Regards, M.A.GhorbaniSample of Taylor Diagram

Attachments:
POSTED BY: M.A. Ghorbani
2 Replies

Hi Ghorbani,

I have virtually no knowledge of Taylor diagrams, however I can recreate them using the code below. I'm not really sure how to input the other data, but either you or someone else on the forum can do it. I attached also the notebook.

enter image description here

observed={917.67`,917.82`,917.93`,918.07`,918.17`,918.07`,917.83`,917.57`,917.4`,917.36`};
GP={917.685866763799`,917.7384339839`,917.926927454734`,918.015626092987`,918.153239315177`,918.226489610354`,917.944984547574`,917.596003036744`,917.41369289588`,917.377935237846`};
ANN={917.7851484231467`,917.8428092168836`,917.938430784518`,918.1388558264852`,918.178189159902`,918.1987992351111`,917.9970819817881`,917.6453125417648`,917.4428835491472`,917.466843545739`};
CC=Correlation[observed,#]&/@{GP,ANN};
RMSE=RootMeanSquare[#-observed]&/@{GP,ANN};
SD=StandardDeviation/@{GP,ANN};
CRMS=StandardDeviation[observed]^2+SD^2-2 StandardDeviation[observed]SD CC;



maxsize=1;
arcinterval=maxsize/5.0;

ticksize=0.02;
frameticksoffset=0.02;
label="Standard deviation";
corrlabel="Correlation";
radialcolor=Darker@Cyan;
observedcolor=Darker@Blue;
rmsarccolor=Brown;

ClearAll[RadialLine,RadialPosition]
RadialLine[corr_?NumericQ]:={{0,0},RadialPosition[corr]}
RadialPosition[corr_?NumericQ]:=AngleVector[{maxsize,ArcCos[corr]}]
arcs=Circle[{0,0},#,{0,Pi/2}]&/@Range[maxsize,0,-arcinterval];
arcs[[1]]={Thick,arcs[[1]]};
radial={{Black,Line[RadialLine/@{0,1}]},{radialcolor,Dashed,Line[RadialLine/@Range[0.1,0.9,0.1]]}};
tickmarks=RadialPosition/@Join[Range[0.05,0.85,0.1],Range[0.91,0.99,0.01]];
tickmarks= {#,(1-ticksize)#}&/@tickmarks;
tickmarks={radialcolor,Line[tickmarks]};
frameticks=Range[0,1,0.1]~Join~{0.95,0.99};
frameticklabels=If[Round[#,0.1]==#,NumberForm[#,{\[Infinity],1}],#]&/@frameticks;
frameticks=MapThread[Text[#1,(1+frameticksoffset)#2,{-1,0},AngleVector[#3]]&,{frameticklabels,RadialPosition/@frameticks,ArcCos[frameticks]}];
axesticks=Range[maxsize,0,-arcinterval];
axesticks=Join[Text[If[Round[#]==#,Round[#],#],{#,-maxsize frameticksoffset},{0,1}]&/@axesticks,Text[If[Round[#]==#,Round[#],#],{-maxsize frameticksoffset,#},{1,0}]&/@axesticks];
framelabels={
    Text[Style[label,14],{maxsize/2,-4maxsize frameticksoffset},{0,1}],
    Text[Style[label,14],{-4maxsize frameticksoffset,maxsize/2},{0,-1},{0,1}],
    Text[Style[corrlabel,14],AngleVector[{(1+6frameticksoffset)maxsize,45\[Degree]}],{1,0},AngleVector[-45\[Degree]]]
};
origin=StandardDeviation[observed];
datapoints={{observedcolor,PointSize[0.02],Point[{origin,0}]}};
meanarc={radialcolor,Thick,Dashed,Circle[{0,0},origin,{0,Pi/2}]};

ClearAll[CreateRMSarcs]
CreateRMSarcs[origin_,arcsize_,maxsize_]:=Module[{start,stop},
    start=If[origin+arcsize>maxsize,
    Pi-ArcCos[(maxsize^2-arcsize^2-origin^2)/(-2arcsize origin)]
    ,0];
    stop=If[origin-arcsize>=0,Pi,
    Pi-ArcCos[origin/arcsize]];
    {Dashed,Thick,rmsarccolor,Circle[{origin,0},arcsize,{start,stop}],Text[arcsize,AngleVector[{origin,0},{arcsize-0.025maxsize,(stop+start)/2}]]}
]

rmsarcs=CreateRMSarcs[origin,#,maxsize]&/@Range[0.2,1.0,0.2];

Graphics[{radial,tickmarks,arcs,frameticks,axesticks,framelabels,meanarc,datapoints,rmsarcs}]
Attachments:
POSTED BY: Sander Huisman

Dear Sander, Thank you for your help. :)

POSTED BY: M.A. Ghorbani
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract