1

I have 3 fancy arrows to use for an illustration. One curved arrow with As the block size increase inscribed, the second pointing up with VARIANCE text inscribed and the third withBIAS text inscribed.

I can only do this in articleclass it does not run in beamerclass where I want it.

I got the text code from Curved text (on multiple lines) within curved arrow using tikz and Fancy arrows with TikZ though I modified them.

Here is my MWE

\documentclass[svgnames]{article}
\usepackage{tikz}
\usetikzlibrary{fadings,shapes.arrows,shadows}
\usetikzlibrary{decorations.text}
\usepackage{xparse}


\tikzfading[name=arrowfading, top color=transparent!0, bottom color=transparent!95]
\tikzset{arrowfill/.style={#1,general shadow={fill=black, shadow yshift=-0.8ex, path fading=arrowfading}}}
\tikzset{arrowstyle/.style n args={3}{draw=#2,arrowfill={#3}, single arrow,minimum height=#1, single arrow,
    single arrow head extend=.3cm,}}

\NewDocumentCommand{\tikzfancyarrow}{O{2cm} O{FireBrick} O{top color=OrangeRed!20, bottom color=Red} m}{
\tikz[baseline=-0.5ex]\node [arrowstyle={#1}{#2}{#3}] {#4};
}



\begin{document}


\begin{tikzpicture}[mypostaction/.style 2 args={
decoration={
    text align={
        left indent=#1},
    text along path, 
    text={#2}
},
decorate
}
]
\coordinate (specRoot) at (-10,0);
\coordinate (testTreeRoot) at (0,0);
\draw[-latex, blue!20!white, line width=5ex]  (specRoot) to[in=135,out=45] (testTreeRoot);


\path [postaction={mypostaction={1cm}{As block length increases}},postaction={mypostaction={1cm}
    /pgf/decoration/raise=-3mm}] (specRoot) to [in=135,out=45] (testTreeRoot);  
\end{tikzpicture}

\begin{tikzpicture}
\tikzfancyarrow[1.5cm][DarkBlue][top color= PaleTurquoise,bottom color=DeepSkyBlue,shape border rotate=90]{VARIANCE}
\tikzfancyarrow[1.5cm][DarkBlue][top color= DeepSkyBlue,bottom color=PaleTurquoise,shape border rotate=270]{BIAS}
\end{tikzpicture}
\end{document}

Here is what I want

I want the curved fancy arrow to be placed side-by-side, (it being at the left of the rest 2 arrows) with the 2 short arrows and to point in an increasing manner (not downward as it is in my text code).

I want the arrow with inscribed VARIANCE to be directly on top of the arrow with BIAS inscribed and the 2 short arrows (with moderate vertical space) to be the same size regardless of the text-lengths.

I want the arrows arranged in beamerclass with \usetheme{Madrid}

enter image description here

1 Answers1

2

It is generally not a good idea to nest tikzpictures . Also in your current setting you need to add fragile to the frame options because the styles have parameters. I basically had to completely rewrite the code to get

\documentclass[svgnames]{beamer}
\usetheme{Madrid}

\usepackage{tikz}
\usetikzlibrary{shapes.arrows,shadows.blur,positioning,arrows.meta,
bending,decorations.text,decorations.pathreplacing}
\usepackage{eqparbox}

\newbox\eqnodebox
\tikzset{equal size/.style={execute at begin
    node={\setbox\eqnodebox=\hbox\bgroup},
    execute at end node={\egroup\eqmakebox[#1][c]{\copy\eqnodebox}}},
    equal size/.default=A,}

\begin{document}
\begin{frame}[t,fragile]
\frametitle{Some arrows}
\begin{tikzpicture}[mypostaction/.style n args=3{
   decoration={
       text align={
           left indent=#1},
       text along path, 
       text={#2},#3
   },
   decorate
   },my arrow/.style={draw=DarkBlue,single arrow,single arrow head extend=.3cm,top color=PaleTurquoise,bottom
   color=DeepSkyBlue,shape border rotate=90,blur shadow,minimum height=2cm}
   ]
 \begin{scope}[local bounding box=Meow]
  \node[my arrow,equal size=A](VAR){VARIANCE};
  \node[my arrow,equal size=A,below=1ex of VAR,shape border rotate=-180]{BIAS};
 \end{scope}
 \draw[thick,decoration=brace,decorate] (Meow.south west) -- (Meow.north west)
  coordinate[midway,xshift=-1em] (aux);
 \draw[-{Latex[bend,length=5em]}, blue!20!white, line width=5ex,
 postaction={mypostaction={1em}{As block length increases}{raise=-0.7ex}}] 
  (aux)++ (-5,-1)  to[bend right]  (aux);

\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

There are many things that got changed.

  • great answer, can you make arrow VARIANCE to face up and arrow BIASE to face down – Daniel James Jan 09 '20 at 17:13
  • can you also make the curved arrow to curve from down to up pointing to the direction you rightly put it now, just to show that `the block size is increasing? – Daniel James Jan 09 '20 at 17:19
  • @DanielJames I do not understand the second comment at all. –  Jan 09 '20 at 17:51
  • On my first comment, I want the arrow with VARIANCE to be up and the mouth of it to face up, while the arrow with BIAS to be under and it mouth to face down. That is for my fist comment. – Daniel James Jan 09 '20 at 18:08
  • @DanielJames All you need to do is to change the shape border rotate and below keys. You wrote "VARIANCE to face up and arrow BIASE to face down" and this is what it looks like now. –  Jan 09 '20 at 18:12
  • @DanielJames You can just add a sketch to your question if you have difficulties changing the keys. I really tried to interpret what you wrote, and posted the answer accordingly. –  Jan 09 '20 at 18:24
  • I have added a sketch – Daniel James Jan 09 '20 at 19:23
  • @DanielJames Updated. Will be offline now. –  Jan 09 '20 at 19:31