Graphics, Figures & Tablespgfplots | Animation in Presentation

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
duboismathieu
Posts: 18
Joined: Tue Apr 01, 2008 1:09 pm

pgfplots | Animation in Presentation

Post by duboismathieu »

Hello,

I have recently discovered pgfplots and I wanted to use it for a beamer presentation.

The figure is a bar chart (more precisely ybar meaning vertical bars). There are several (symbolic) x values and several plots. Here is a simple example (borrowed from pgfplots manual p27):

Code: Select all

\begin{tikzpicture}
\begin{axis}[
ybar,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
ylabel={\#participants},
symbolic x coords={tool8,tool9,tool10},
xtick=data,
nodes near coords,
nodes near coords align={vertical},
]
\addplot coordinates {(tool8,7) (tool9,9) (tool10,4)};
\addplot coordinates {(tool8,4) (tool9,4) (tool10,4)};
\addplot coordinates {(tool8,1) (tool9,1) (tool10,1)};
\legend{used,understood,not understood}
\end{axis}
\end{tikzpicture}
What I would like to do is to x values one after another: slide 1 should show the three bar for tool8, slide 2 adds the three bars of tool9, etc...

Any idea?
Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply