Is there any package or a way to draw Taylor diagrams (From this paper) easily?

Any help will be appreciated.

enter image description here

  • Welcome to TeX.Stackexchange! – samcarter Oct 11 at 20:12
  • 2
    I'm not sure if there is a dedicated package for only these diagrams, but I think you could just do them with polar axes that come with pgfplots, particularly see section 5.10.6 Partial Polar Axes of the manual as well as 5.11. SMITH CHARTS. – marmot Oct 11 at 20:37
up vote 7 down vote accepted

OK. So, I won't do all the work for you. But, I will do enough so that you should be able to figure out how to add everything else that remains to be done.

enter image description here

What I show you here is as follows:

  • How to clip a portion of a picture
  • How to draw concentric circles about a given center
  • How to label along a curved path
  • How to place a label at a point along a path
  • How label at the end points of a line
  • How to get different styles of dashed and dotted lines
  • How to plot points
  • Different approaches to scaling the text

And, I believe that should allow you to complete the rest of the picture.

Here's the code to generate the diagram:

\documentclass[tikz,border=6pt]{standalone}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.text}
\pagestyle{empty}
\begin{document}

\begin{tikzpicture}[
  x={(4cm,0)},
  y={(0,4cm)},
  radius=4cm,
  ]
  %% notation (<angle>:<radius>)   gives polar coordinates 
  %%          (<x-coor>,<y-coord>) Euclidean coordinates

  %% draw semi-circles clipped by the 1st quadrant arc
  %% `scope` prevents the entirety of the remainder of
  %%         picture from being clipped.
  \begin{scope}
    \draw[clip] (0,0) -- (1,0) arc (0:90:1) -- cycle;
    \foreach \myr in {1,2,...,5}
      {
        %% draw a circle centered at (5/7,0)
        %% arc starts at point (\myr/6,0) and proceeds through an
        %% angle of 180 degrees with a radius of \myr/6 units
        \draw[blue,densely dotted] (5/7,0) ++ (\myr/6,0) arc (0:180:\myr/6);
      }
  \end{scope}

  %% place a label along one of the above clipped arcs.
  \path (5/7,0) ++ (2/6,0) arc (0:180:2/6) node[pos=0.75,
                                                rotate=0.75*180-90,
                                                anchor=south,
                                                inner sep=4pt,
                                                scale=0.5,
                                                blue] (A) {$0.25$};

  %% label the correlation coefficient values
  \pgfkeys{/pgf/number format/precision=1}
  \foreach \myp in {0,1,2,...,11}
    {
      %% calculate the angle \myangle from the integer \myp
      \pgfmathsetmacro\myangle{{90*(12-\myp)/12}}
      \pgfmathparse{\myp/10}
      \pgfmathroundtozerofill{\pgfmathresult}
      \pgfmathsetmacro\mylabel{\pgfmathresult}
      %% handle labels that don't follow the previous pattern
      \ifdim\mylabel pt=1.0pt%%
        \def\mylabel{0.95}
      \fi
      \ifdim\mylabel pt=1.1pt%%
        \def\mylabel{0.99}%%
      \fi
      %% draw the dashed lines from orgin to arc with labels outside arc
      \draw[gray!50,
            dash pattern=on 1.25pt off 0.5pt,
            line width=0.1pt] (\myangle:1) node[black,
                                                anchor=180+\myangle] 
                                                {$\scriptscriptstyle\mylabel$}  -- (0,0);
    }

  %% labeling along a curve                                        
  %% a fancy approach that's necessary for labels conforming to    
  %% a curved path.  Not necessary for labels along straight lines.
  \path[postaction={decoration={text along path,
                                text align=center,
                                text={Correlation Coefficient}},
                    decorate}]
       (0,1.15) arc (90:0:1.15);

  %% some data points
  \node[blue]           at (35:4/7+1/2*1/7) {$\diamond$};
  \node[red,scale=0.5]  at (32:5/7)         {$\pmb{\triangle}$};

  %% draw the quarter circle in the first quadrant
  \draw (0,0) -- (1,0);
  \draw (0,0) -- (1,0) arc (0:90:1) -- cycle;

\end{tikzpicture}

\end{document}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.