TikZ:正方形和箭头

TikZ:正方形和箭头

有人可以帮我使用 TikZ 重新创建该图表吗: 在此处输入图片描述

这是我目前所得到的(使用鸽子代替蝴蝶),它只是四个格子中的一个,并且没有箭头:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,chains,%
    decorations.pathreplacing}
\usepackage{phaistos} % animal symbols

\begin{document}
    \begin{tikzpicture}[
        start chain = going right,
        node distance = 0pt,
        AStyle/.style={draw, minimum width=2em, minimum height=2em, 
           outer sep=0pt, on chain, fill=yellow!0!white}]
        \node [AStyle] (1) {\huge\textcolor{red}{\PHdove}};
        \node [AStyle] (4) {\huge\textcolor{blue}{\PHdove}};
        \node [AStyle] (5) {\huge\textcolor{green!50!black}{\PHdove}};
        \node [AStyle] (6) {\huge\textcolor{purple}{\PHdove}};
    \end{tikzpicture}
\end{document}

编辑:我只是想重新创建这个方案,而不是蝴蝶本身。

答案1

这是一个可能的解决方案,以rectangle split作为主节点和定位库来帮助放置它们。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shapes.multipart,
     positioning}
\usepackage{phaistos} % animal symbols

\begin{document}
\begin{tikzpicture}[font=\sffamily,
    array/.style={rectangle split, 
            rectangle split parts=4, 
            rectangle split horizontal, 
            draw, minimum height=2em, font=\huge},
    arrow/.style={-{LaTeX}, shorten >=2pt, shorten <=2pt}
    ]
   \node [array, label={Species presence/absence}] (1) {%
            \textcolor{red}{\PHdove}
        \nodepart{two}
            \textcolor{blue}{\PHdove}
        \nodepart{three}
            \textcolor{green!50!black}{\PHdove}
        \nodepart{four}
            \textcolor{purple}{\PHdove}};

   \node [array, below=of 1] (2) {%
            \textcolor{red}{\PHdove}
        \nodepart{two}
            \textcolor{blue}{\PHdove}
        \nodepart{three}
            \textcolor{green!50!black}{\PHdove}
        \nodepart{four}
            \textcolor{purple}{\PHdove}};

   \node [array, right=2cm of 1, label={Species presence/absence}] (3) {%
            \textcolor{red}{\PHdove}
        \nodepart{two}
            \textcolor{blue}{\PHdove}
        \nodepart{three}
            \textcolor{green!50!black}{\PHdove}
        \nodepart{four}
            \textcolor{purple}{\PHdove}};

   \node [array, below=of 3] (4) {%
            \textcolor{red}{\PHdove}
        \nodepart{two}
            \textcolor{blue}{\PHdove}
        \nodepart{three}
            \textcolor{green!50!black}{\PHdove}
        \nodepart{four}
            \textcolor{purple}{\PHdove}};

    \draw[arrow] (1)--(2) node[midway, right, align=left] {Stochastic\\Fluctuation};

    \draw[arrow] (2)--++(270:15mm) node[midway, right, align=left] {Stochastic\\Fluctuation} node[below] {\dots};

    \draw[arrow] (3)--(4) node[midway, right, align=left] {Stochastic\\Fluctuation};

    \draw[arrow] (4)--++(270:15mm) node[midway, right, align=left] {Stochastic\\Fluctuation} node[below] {\dots};

    \draw[arrow] ([xshift=-3mm]1.north west) -- ([shift={(-3mm,-6mm)}]2.south west) node[midway, rotate=90, above]{Time};

    \draw[arrow] ([xshift=-3mm]3.north west) -- ([shift={(-3mm,-6mm)}]4.south west) node[midway, rotate=90, above]{Time};

\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容