为绘图添加模糊阴影

为绘图添加模糊阴影

我怎样才能使情节具有下图中所示的模糊效果?

在此处输入图片描述

\documentclass[tikz,border=7pt]{standalone}
\usetikzlibrary{positioning,arrows.meta}
\begin{document}
    \begin{tikzpicture}[node distance=0mm,minimum height=1cm,outer sep=3mm,scale=0.7,>=Latex,font=\footnotesize,
    indication/.style={minimum height=0cm,outer sep=0mm},
    oneblock/.style={transform shape,minimum width=1cm,draw,thick},
    fullset/.style={transform shape,minimum width=10cm,draw,thick}]
    % left part of picture
    \node[fullset,anchor=west] at (0,0) (A) {};
    \node[above=of A.north,indication] (ATXT) {TRAINING SET};
    \node[oneblock,minimum width=2cm,anchor=west,right=of A,fill=lightgray,outer sep=0mm] (A1) {};
    \path (ATXT) -| (A1) node[midway] {TEST SET};
    \node[fullset,anchor=west] at (0,-4) (B) {};
    \foreach \x in {0,1,...,9}
    {
        \draw (B.west) +(\x,0) node[oneblock,anchor=west,draw] {};
    }
    \draw[->] (A) -- (B) node[midway,fill=white,indication] {divide into 10 folds of equal size};

    % right part of picture
    \begin{scope}[xshift=15cm,scale=0.5,local bounding box=rightside box]
    \foreach \x in {0,1}
    {
        \foreach \y in {0,1,...,4}
        {
            \draw (\x*11,0) +(0,-\y*2) node[fullset,anchor=west] {};
            \draw (\x*11,0) +(\x*5+\y,-\y*2) node[oneblock,draw,anchor=west,fill=lightgray] {};
        }
    }
    \coordinate (R) at (rightside box.west);
    \end{scope}

    % connecting arrow
    \draw[->] (B.east) -- +(2.5,0) node[below,align=center,indication] {run experiments\\using 10 different\\partitionings} |- (R);
    \end{tikzpicture}
\end{document}

到目前为止我已经实现了这个目标:

在此处输入图片描述

答案1

不知道。

\documentclass[tikz,border=7pt]{standalone}
\usetikzlibrary{positioning,arrows.meta,shadows.blur}
\begin{document}
    \begin{tikzpicture}[node distance=0mm,minimum height=1cm,scale=0.7,>=Latex,font=\footnotesize,
    indication/.style={minimum height=0cm,outer sep=0mm},
    oneblock/.style={transform shape,minimum width=1cm,draw,thick},
    fullset/.style={transform shape,minimum width=10cm,draw,thick,inner
    sep=0pt,outer sep=0pt},
    pshadow/.style={fill=white,inner sep=0pt,blur shadow={shadow blur steps=10,
    shadow xshift=0.1em,shadow
yshift=#1,shadow blur radius=3pt,shadow scale=1}},
nshadow/.style={pshadow=-0.1em,pshadow=0.2em}
]
    % left part of picture
    \node[fullset,anchor=west,nshadow] at (0,0) (A) {};
    \node[above=of A.north,indication] (ATXT) {TRAINING SET};
    \node[oneblock,minimum width=2cm,anchor=west,right=of A,outer sep=0mm,nshadow,fill=lightgray] (A1) {};
    \path (ATXT) -| (A1) node[midway] {TEST SET};
    \node[fullset,anchor=west,nshadow] at (0,-4) (B) {};
    \foreach \x in {0,1,...,9}
    {
        \draw (B.west) +(\x,0) node[oneblock,anchor=west,draw] {};
    }
    \draw[->] (A) -- (B) node[midway,fill=white,indication] {divide into 10 folds of equal size};

    % right part of picture
    \begin{scope}[xshift=15cm,scale=0.5,local bounding box=rightside box]
    \foreach \x in {0,1}
    {
        \foreach \y in {0,1,...,4}
        {
            \draw (\x*11,0) +(0,-\y*2) node[nshadow,fullset,anchor=west] (u-\x-\y){};
            \draw (\x*11,0) +(\x*5+\y,-\y*2) node[oneblock,draw,anchor=west,fill=lightgray] (b-\x-\y){};
        }
    }
    \coordinate (R) at (rightside box.west);
    \end{scope}

    % connecting arrow
    \draw[->] (B.east) -- +(2.5,0) node[below,align=center,indication] {run experiments\\using 10 different\\partitionings} |- (R);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容