4

How can I give the plot the blur effect that you can see in the picture below?

enter image description here

\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}

So far I have achieved this:

enter image description here

  • Did you try loading shadow.blur and adding blur shadow to the nodes that should have a shadow? – user121799 Jul 23 '19 at 16:34
  • 1
    \usetikzlibrary{shadows.blur,shapes.multipart} \tikzset{grimsel/.style={rectangle split,rectangle split parts=1,draw, fill=white,blur shadow,rounded corners,align=center}} – NaveganTeX Jul 23 '19 at 16:35
  • 1
    I did but it does not work / look fine – NaveganTeX Jul 23 '19 at 16:35
  • Please add the full code you have tried. IMHO you only need to adjust shadow blur radius, the scale and set the shift to 0. – user121799 Jul 23 '19 at 16:37
  • Where is the radius?! – NaveganTeX Jul 23 '19 at 16:39
5

Dunno.

\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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.