-1

I'll just cut to the chase. I'd like to do this: enter image description here I would think tikz is the thing to use, but I'm not sure how to make the curvy arrows. Any help would be much appreciated. Thanks!

Ben W
  • 203

1 Answers1

4

The simplest code for this case

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\sffamily
\node (a) at (-2,0) {probability};
\node[align=center] (b) at (2,0) {percent\\change};
\draw[-latex] (a) to[out=60,in=120] node[midway,font=\scriptsize,above] {multiply by 100\%} (b);
\draw[-latex] (b) to[out=-120,in=-60] node[midway,font=\scriptsize,below] {divide by 100\%} (a);
\end{tikzpicture}
\end{document}

enter image description here


These are the best ways IMO (with \GREAT (not \great or \Great) help from Skillmon and marmot in this question)

Based on Skillmon's answer:

\documentclass[tikz]{standalone}
\usetikzlibrary{bending,decorations.text}
\begin{document}
\begin{tikzpicture}
\sffamily
\node (a) at (-2,0) {probability};
\node[align=center] (b) at (2,0) {percent\\change};
\begin{scope}
\catcode`\%=12
\draw[-latex,postaction={decorate,decoration={raise=-1.5ex,text along path,text
align=center,text={|\scriptsize|multiply by 100%}}}] (a) to[out=60,in=120] (b);
\draw[latex-,postaction={decorate,decoration={raise=.5ex,text along path,text
align=center,text={|\scriptsize|divide by 100%}}}] (a) to[out=-60,in=-120] (b);
\end{scope}
\end{tikzpicture}
\end{document}

Based on marmot's answer:

\documentclass[tikz]{standalone}
\usetikzlibrary{bending,decorations.text}
\begin{document}
\begin{tikzpicture}
\sffamily
\node (a) at (-2,0) {probability};
\node[align=center] (b) at (2,0) {percent\\change};
\draw[-latex,postaction={decorate,decoration={raise=-1.5ex,text along path,text
align=center,text={|\scriptsize|multiply by 100{\%}}}}] (a) to[out=60,in=120] (b);
\draw[latex-,postaction={decorate,decoration={raise=.5ex,text along path,text
align=center,text={|\scriptsize|divide by 100{\%}}}}] (a) to[out=-60,in=-120] (b);
\end{tikzpicture}
\end{document}

Both give

enter image description here

  • If you just load (without explicitly using it) the library bending the result will become even prettier because then the arrows are taken into account for the path construction. –  Mar 28 '19 at 15:24
  • @marmot Thanks! I am working on an improvement. Maybe I will add this to it. –  Mar 28 '19 at 15:40
  • But I need the code for "percent chance" not "percent change." Haha just kidding. Perfect! Thanks! – Ben W Mar 28 '19 at 20:01
  • @BenW Ohh what happened to my eyes :) –  Mar 29 '19 at 05:49