spider.tex 2.01 KB
\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{shapes}

\begin{document}

\newcommand{\D}{5}  % number of dimensions (config option)
\newcommand{\U}{5}  % number of scale units (config option)

\newdimen\R % maximal diagram radius (config option)
\R=5cm
\newdimen\L % radius to put dimension labels (config option)
\L=5.2cm

\newcommand{\A}{360/\D} % calculated angle between dimension axes
\newcommand{\B}{90-\A} % starting angle (config option)

\begin{tikzpicture}
  \path (0:0cm) coordinate (O); % define coordinate for origin

  \foreach \X in {1,...,\D}{
    \draw (\X*\A+\B:0) -- (\X*\A+\B:\R);
  }

  \foreach \Y in {0,...,\U}{
    \foreach \X in {1,...,\D}{
      \path (\X*\A+\B:\Y*\R/\U) coordinate (D\X-\Y);
      \fill (D\X-\Y) circle (1pt);
    }
    \draw [opacity=0.3] (\B:\Y*\R/\U) \foreach \X in {1,...,\D}{
        -- (\X*\A+\B:\Y*\R/\U)
    } -- cycle;
  }

  %\path (1*\A+\B:\L) node[anchor=south] (L1) {Contains};
  %\path (2*\A+\B:\L) node[anchor=east]  (L2) {DistanceIn};
  %\path (3*\A+\B:\L) node[anchor=north] (L3) {DistanceOut};
  %\path (4*\A+\B:\L) node[anchor=north] (L4) {RayCastIn};
  %\path (5*\A+\B:\L) node[anchor=west]  (L5) {RayCastOut};

  \draw [color=red, fill=red, line width=1.5pt,opacity=0.5]
    (D1-3) -- (D2-5) -- (D3-2) -- (D4-4) -- (D5-1) -- cycle;

  \draw [color=blue, fill=blue, line width=1.5pt,opacity=0.5]
    (D1-1) -- (D2-3) -- (D3-4) -- (D4-2) -- (D5-4) -- cycle;

  \draw [color=green, fill=green, line width=1.5pt,opacity=0.5]
    (D1-3) -- (D2-4) -- (D3-2) -- (D4-3) -- (D5-2) -- cycle;

  \draw [color=orange, fill=orange, line width=1.5pt,opacity=0.5]
    (D1-4) -- (D2-1) -- (D3-3) -- (D4-1) -- (D5-3) -- cycle;

  %\draw [fill=red, opacity=0.5] (\R,\R) circle (2pt) node[anchor=west] {Geant4};
  %\draw [fill=blue, opacity=0.5] (\R,\R-1em) circle (2pt) node[anchor=west] {ROOT};
  %\draw [fill=blue, opacity=0.5] (\R,\R-1em) circle (2pt) node[anchor=west] {ROOT};
  %\draw [fill=blue, opacity=0.5] (\R,\R-1em) circle (2pt) node[anchor=west] {ROOT};
\end{tikzpicture}

\end{document}