Drawing a pie chart
Pie charts are famous for showing proportions. Their main characteristic is that all items usually sum up to 100%. They are displayed as segments of a disc.
How to do it...
We will use the pgf-pie package, which builds on TikZ and is specialized in generating pie charts. Follow these steps:
- Start with a document class:
\documentclass{article}
- Load the pgf-pie package:
\usepackage{pgf-pie}
- Begin the document:
\begin{document}
- Begin a TikZ picture, which will be the container for the pie chart:
\begin{tikzpicture}
- Draw the pie chart using this command:
\pie [rotate = 180] {62/\TeX\ Live and Mac\TeX, 32/MiK\TeX\ and Pro\TeX t, 6/Other \TeX}
- End the TikZ picture and the whole document:
\end{tikzpicture} \end{document}
- Compile, and take a look at the output:
Figure 6.11 – A pie chart
How it works...
\pie is the only command of the pgf-pie...