4

I want to build a block scheme to visualize a workflow. I created a tikzpicture containing nodes that appear one by one. This works so far.

Now I want to add illustrations and equations with every step. They should appear right and left of the workflow tree together with the corresponding tree item.

Please see the MWE for more. My problem is that the order of appearance of the various textblocks is messed up.

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes,calc}
\usepackage{pgfplots}
\usepackage[absolute,overlay]{textpos}

\usetheme{Singapore}

\newlength\figureheight
\newlength\figurewidth

\begin{document}

\begin{frame}
  \frametitle{Fundamentals}
  \framesubtitle{X-ray CT imaging statistics}

  % This should appear with 'generation'
  \begin{textblock*}{5cm}(0cm,2.5cm)
    \setlength\figurewidth{5cm}
    \setlength\figureheight{3cm}
    % created this with matplotlib2tikz
    \input{poisson_distribution.tex}
  \end{textblock*}

  \begin{center}
    \begin{tikzpicture}[node distance=5mm, >=latex',
        block/.style = {draw, rectangle, minimum height=10mm, minimum width=28mm,align=center},]
      \node [block] (generation) {Generation};
      \pause
      \node [block, below=of generation] (interaction) {Interaction\\with matter};
      \draw[->] (generation) edge (interaction);
      \pause
      \node [block, below=of interaction] (detection) {Detection};
      \draw[->] (interaction) edge (detection);
      \pause
      \node [block, below=of detection] (processing) {Processing};
      \draw[->] (detection) edge (processing);
    \end{tikzpicture}
  \end{center}

  % This should appear with 'interaction'
  \begin{textblock*}{5cm}(8cm,4.5cm)
    \visible<2->{
      $ \rho_i(\mu) = \exp \left( -\int_L \mu_i(x)\ dx \right) $
    }
  \end{textblock*}
\end{frame}

\end{document}

And the input poisson_distribution.tex:

\begin{tikzpicture}

\draw[draw=white,fill=lightgray] (axis cs:0,0) rectangle (axis cs:1,1);
\begin{axis}[
xmin=0, xmax=35,
ymin=0, ymax=1200,
axis on top,
width=\figurewidth,
height=\figureheight,
ticklabel style={font=\tiny}
]
\draw[draw=black,fill=blue] (axis cs:3,0) rectangle (axis cs:4,2);
\draw[draw=black,fill=blue] (axis cs:4,0) rectangle (axis cs:5,5);
\draw[draw=black,fill=blue] (axis cs:5,0) rectangle (axis cs:6,18);
\draw[draw=black,fill=blue] (axis cs:6,0) rectangle (axis cs:7,62);
\draw[draw=black,fill=blue] (axis cs:7,0) rectangle (axis cs:8,138);
\draw[draw=black,fill=blue] (axis cs:8,0) rectangle (axis cs:9,200);
\draw[draw=black,fill=blue] (axis cs:9,0) rectangle (axis cs:10,314);
\draw[draw=black,fill=blue] (axis cs:10,0) rectangle (axis cs:11,471);
\draw[draw=black,fill=blue] (axis cs:11,0) rectangle (axis cs:12,697);
\draw[draw=black,fill=blue] (axis cs:12,0) rectangle (axis cs:13,864);
\draw[draw=black,fill=blue] (axis cs:13,0) rectangle (axis cs:14,945);
\draw[draw=black,fill=blue] (axis cs:14,0) rectangle (axis cs:15,966);
\draw[draw=black,fill=blue] (axis cs:15,0) rectangle (axis cs:16,1014);
\draw[draw=black,fill=blue] (axis cs:16,0) rectangle (axis cs:17,911);
\draw[draw=black,fill=blue] (axis cs:17,0) rectangle (axis cs:18,838);
\draw[draw=black,fill=blue] (axis cs:18,0) rectangle (axis cs:19,693);
\draw[draw=black,fill=blue] (axis cs:19,0) rectangle (axis cs:20,591);
\draw[draw=black,fill=blue] (axis cs:20,0) rectangle (axis cs:21,414);
\draw[draw=black,fill=blue] (axis cs:21,0) rectangle (axis cs:22,323);
\draw[draw=black,fill=blue] (axis cs:22,0) rectangle (axis cs:23,213);
\draw[draw=black,fill=blue] (axis cs:23,0) rectangle (axis cs:24,134);
\draw[draw=black,fill=blue] (axis cs:24,0) rectangle (axis cs:25,69);
\draw[draw=black,fill=blue] (axis cs:25,0) rectangle (axis cs:26,58);
\draw[draw=black,fill=blue] (axis cs:26,0) rectangle (axis cs:27,32);
\draw[draw=black,fill=blue] (axis cs:27,0) rectangle (axis cs:28,16);
\draw[draw=black,fill=blue] (axis cs:28,0) rectangle (axis cs:29,5);
\draw[draw=black,fill=blue] (axis cs:29,0) rectangle (axis cs:30,4);
\draw[draw=black,fill=blue] (axis cs:30,0) rectangle (axis cs:31,3);
\draw[fill=white,draw opacity=0] (axis cs:0,0) rectangle (axis cs:1,1);
\end{axis}

\end{tikzpicture}

Appreciate your help!

5

I think you're making this more complicated than it needs be. Instead of the textblocks, you can use columns, adding the poisson_distribution in the first, and the flowchart in the second. To make the equation come up the same time as the same time as the corresponding part of the chart, simply add it as a label to that node.

\documentclass{beamer}

\usepackage{pgfplots}
\usetikzlibrary{arrows,positioning,shapes,calc}
\usepackage[absolute,overlay]{textpos}

\usetheme{Singapore}

\newlength\figureheight
\newlength\figurewidth

\begin{document}

\begin{frame}
  \frametitle{Fundamentals}
  \framesubtitle{X-ray CT imaging statistics}

\begin{columns}[T]
\begin{column}{4.5cm}
    \setlength\figurewidth{5cm}
    \setlength\figureheight{3cm}
    % created this with matplotlib2tikz
    \input{poisson_distribution.tex}
\end{column}
\begin{column}{7.5cm}
    \begin{tikzpicture}[node distance=5mm, >=latex',
        block/.style = {draw, rectangle, minimum height=10mm, minimum width=28mm,align=center},]
      \node [block] (generation) {Generation};
      \pause
      \node [block, below=of generation,
       label=right:{$\rho_i(\mu) = \exp \left( -\int_L \mu_i(x)\ dx \right)$}] (interaction) {Interaction\\with matter};
      \draw[->] (generation) edge (interaction);
      \pause
      \node [block, below=of interaction] (detection) {Detection};
      \draw[->] (interaction) edge (detection);
      \pause
      \node [block, below=of detection] (processing) {Processing};
      \draw[->] (detection) edge (processing);
    \end{tikzpicture}
  \end{column}
\end{columns}
\end{frame}

enter image description here

  • Thank you, that works just out of the box. Indeed, your approach is way simpler. I also managed to add another tikzpicture in the left-hand column that appears together with 'detection'. – pylipp Jun 13 '16 at 9:29

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.