答案1
可以使用 来完成这些操作copy shadow
,它最多支持两个副本。如果你想要更多,你可以为此编写一种新样式(例如triple shadow
,)或直接使用 复制框foreach
。第一个选项已在这个很好的答案。然而,在本例中,这些都是简单的正方形,第二种选择可以说更容易实现。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{fit,positioning,backgrounds,decorations.pathreplacing}
\begin{document}
\definecolor{leftcol}{RGB}{68,98,96}
\definecolor{rightcol}{RGB}{39,61,73}
\begin{tikzpicture}[square/.style={rectangle,minimum width=1cm,minimum
height=1cm,draw=leftcol!80,thick,fill=white},font=\sffamily\bfseries]
\node[square] (square1){};
\foreach \X [count=\Y] in {2,3,4}
{\node[anchor=north west,below right=2mm and 2mm of square\Y.north west,square] (square\X){};}
\node[square,below=1.5cm of square1] (square5){};
\node[fit=(square1)(square4)](fit1){};
\draw[decorate,decoration=brace,white,very thick] (fit1.north east) --
(fit1.south east) node[midway,right,align=left] (Train) {Train \& Valitidate\\
Models};
\draw[decorate,decoration={brace},white,very thick] (square5.south east) --
(square5.south west) node[midway,below] (Test) {Test Score};
\draw[thick,-latex,white] (Train) -- (Test.north east);
\begin{scope}[on background layer]
\node[fit=(square1) (Test) (Train),left color=leftcol,right color=rightcol,
inner sep=3mm]{};
\end{scope}
\end{tikzpicture}
\end{document}