![带箭头且外部有单元格的数组](https://linux22.com/image/476578/%E5%B8%A6%E7%AE%AD%E5%A4%B4%E4%B8%94%E5%A4%96%E9%83%A8%E6%9C%89%E5%8D%95%E5%85%83%E6%A0%BC%E7%9A%84%E6%95%B0%E7%BB%84.png)
我想在图片中绘制一个数组,数组外面有一个单元格,箭头、边框和一些单元格都是彩色的。你能告诉我怎么做吗?
答案1
下次,请提供一个最小工作示例。这是一个开始...
\documentclass[tikz]{standalone}
\usetikzlibrary{chains, positioning, arrows.meta, bending, shapes.arrows}
\begin{document}
\begin{tikzpicture}
[
-{Stealth[length=2.5pt]},
every node/.style={draw, text width=25pt, text centered},
my arrow/.style={shape=single arrow, rotate=90, inner sep=1pt, outer sep=0pt, single arrow head extend=1pt, minimum height=7.5pt, text width=0pt, draw=blue!50, fill=blue!25}
]
\begin{scope} [start chain, node distance=0pt]
\node [on chain] (2) {2};
\node [on chain] (4) {4};
\node [on chain] (1 phantom) {\phantom{1}};
\node [on chain] (3) {3};
\end{scope}
\node (1) [below=15pt of 1 phantom] {1};
\draw (1 phantom.south) -- (1.north);
\draw (2.north) [out=25, in=155] to (4.north);
\draw (4.north) [out=25, in=155] to (1 phantom.north);
\node [below=2.5pt of 2.south, anchor=east, my arrow] {};
\node [below=2.5pt of 3.south, anchor=east, my arrow] {};
\draw [draw=yellow, thick, opacity=.75] (4.south east) +(0,-2.5pt) -- (4.north east) -- +(0,2.5pt);
\end{tikzpicture}
\end{document}