O'Reilly logo

LaTeX Cookbook by Stefan Kottwitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Drawing a pie chart

Pie charts are popular for showing proportions. A pie chart's main characteristic is that all items usually sum up to 100 percent. They are displayed as segments of a disc.

As an example, we will use a pie chart to display the relative amount of questions about different TeX distributions.

How to do it...

We will use the pgf-pie package, which builds on TikZ and is specialized for generating pie charts. Follow these steps:

  1. Start with a document class:
    \documentclass{article}
    
  2. Load the pgf-pie package:
    \usepackage{pgf-pie}
    
  3. Begin the document:
    \begin{document}
    
  4. Begin a TikZ picture, which will be the container of the pie chart:
    \begin{tikzpicture}
    
  5. Draw a pie chart using this command:
     \pie [rotate = 180] {62/\TeX\ Live and Mac\TeX, 32/MiK\TeX\ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required