如何使用 TikZ 中的图像重新创建此“蜘蛛”图表?

如何使用 TikZ 中的图像重新创建此“蜘蛛”图表?

我需要制作类似的东西,但我不知道该怎么做,也不知道这种图表到底叫什么。我将使用不同的图像/人物和更简单的布局,但中间仍然是 X,周围是 Y、Y、Z。希望有人能帮忙。

图表

答案1

这是一个使用选项TikZ

在此处输入图片描述

代码:

\documentclass[border=5pt]{standalone}
\usepackage{varwidth}
\usepackage{tikz}
\usetikzlibrary{decorations.text}

\begin{document}

\begin{tikzpicture}[
  scale=0.75,
  mydot/.style={
    circle,
    fill,
    inner sep=1.5pt
  }
]
\def\Radius{13cm}
% Filling some sectors
\foreach \IAngulo/\FAngulo\Color in {%
  18/-198/{orange},%
  72/36/{purple},%
  108/144/{cyan}%
}
{
\fill[\Color!20]
  (\IAngulo:3cm) -- 
  (\IAngulo:\Radius) arc [start angle=\IAngulo,end angle=\FAngulo,radius=\Radius] --
  (\FAngulo:3cm) arc [start angle=\FAngulo,end angle=\IAngulo,radius=3cm] -- 
  cycle;
}

% The arrows from/to the center
\foreach \Angulo in {36,54,72}
  \draw[latex-latex,purple,thick] (\Angulo:2cm) -- (\Angulo:\Radius+0.75cm);  
\foreach \Angulo in {162,180,...,360,18}
  \draw[-latex,orange,thick] (\Angulo:2cm) -- (\Angulo:\Radius+0.75cm);  
\foreach \Angulo in {108,126,144}
  \draw[latex-,cyan,thick] (\Angulo:2cm) -- (\Angulo:\Radius+0.75cm);  

% concentric circles and their texts
\foreach \Valor/\Texto in {%
  3/{Poes\'ia},%
  4/{Simbolismo},%
  5/{Romanticismo},%
  6/{Terror},%
  7/{Sobrenatural},%
  8/{Relato},%
  9/{Cuentistas},%
  10/{Policiaca},%
  11/{Periodismo},%
  12/{Aventuras},%
  13/{Moderno}%
  }
{
  \draw (0,0) circle [radius=\Valor] node at (90:\Valor) [fill=white,font=\footnotesize\scshape] {\Texto};
}
% Images
% image at the center
\begin{scope}
\clip
  (0,0) circle [radius=2cm];
\node[inner sep=0pt,circle] at
  (0,0)
  {\includegraphics[width=4cm]{example-image-a}};
\end{scope}
% image at the perimeter
\foreach \Angulo/\Imagen/\Name/\PosName/\Year in  {
  0/example-image-a/{Ambrose\\Bierce}/90/{1928--1987},%
  18/example-image-b/{Charles\\Baudelaire}/90/{1928--1987},%
  36/example-image-c/{Sheridan\\Le Fanu}/90/{1928--1987},%
  54/example-image/{Charles\\Dickens}/90/{1928--1987},%
  72/example-image-c/{Mary\\Shelley}/90/{1928--1987},%
  108/example-image-a/{Dante\\Allighieri}/90/{1928--1987},%
  126/example-image-b/{William\\Blake}/90/{1928--1987},%
  144/example-image-1x1/{Lord\\Byron}/90/{1928--1987},%
  162/example-image/{H.P.\\Lovecraft}/90/{1928--1987},%
  180/example-image-c/{G.K.\\Chesterton}/90/{1928--1987},%
  198/example-image-b/{Arthur Conan\\Doyle}/90/{1928--1987},%
  216/example-image/{Guy de\\Maupassant}/270/{1928--1987},%
  234/example-image-a/{Gustavo\\Adolfo Becquer}/270/{1928--1987},%
  252/example-image-1x1/{Another\\Name}/270/{1928--1987},%
  270/example-image-b/{Stephen\\King}/270/{1943},%
  288/example-image-c/{Jorge Luis\\Borges}/270/{1928--1987},%
  306/example-image-a/{Franz\\Kafka}/270/{1928--1987},%
  324/example-image/{Anton\\Chejov}/270/{1928--1987},%
  342/example-image-c/{Oscar\\Wilde}/90/{1928--1987}%
  }
{
\begin{scope}
\clip
  (\Angulo:16cm) circle [radius=1.5cm];
\node[inner sep=0pt,circle] at
  (\Angulo:16cm)
  {\includegraphics[width=3cm]{\Imagen}};
\end{scope}
\node[
  label={\PosName:{\begin{varwidth}{100cm}
                \centering\scshape\Name\end{varwidth}}},
  minimum size=2.2cm] at
  (\Angulo:16cm) {};
\ifnum\Angulo>-1
  \ifnum\Angulo<181
    \def\YearPos{-90+\Angulo}
  \else
    \def\YearPos{90+\Angulo}
  \fi
\fi      
\node[rotate=\YearPos] at
  (\Angulo:14.1cm) {\Year};
}
% The dots over radii
\foreach \Angulo/\Lista in {
  0/{3,6,8},%
  18/{4,7,12},%
  36/{5,10},%
  54/{4,8},%
  72/{3,6,10},%
  108/{4,6,11,12},%
  126/{6,9},%
  144/{3,45,6,8},%
  162/{6,9},%
  180/{5,6,13},%
  198/{6,10},%
  216/{7,11},%
  234/{3,6,12},%
  252/{7,13},%
  270/{5,6,10},%
  288/{4,6,8},%
  306/{5,6,11},%
  324/{3,6,7},%
  342/{3,6,10,13},%
  }
{
  \foreach \Valor in \Lista
  \node[mydot,overlay] at (\Angulo:\Valor cm) {};
}

% Outer texts
\foreach \IAngulo/\FAngulo/\Texto in {%
  72/36/{|\LARGE\scshape\color{purple}|Contempor{\'a}neos},%
  180/360/{|\LARGE\scshape\color{orange}|Influidos por Poe},%
  144/108/{|\LARGE\scshape\color{cyan}|Influencian a Poe}%
}
{
\draw[
  decoration={
    text along path,
    text align=center,
    text={\Texto}
  },
  decorate
  ]
 (\IAngulo:20cm) arc [start angle=\IAngulo,end angle=\FAngulo,radius=20cm];
}
\end{tikzpicture}

\end{document}

相关内容