39. Matplotlib: Pie charts, and adding a title

This post is also available as a PDF and as a Jupyter-Notebook

A simple bar chart

As with all matplotlib charts, pie charts are highly configurable. Here we just show the simplest of pie charts.

import matplotlib.pyplot as plt

labels = 'Dan','Sean','Andy','Mike','Kerry'

cake_consumption = [10, 15, 12, 30, 100]

plt.pie(cake_consumption, labels=labels)
plt.title ("PenCHORD's Cake Consumption")

plt.show()

A pie chart:

plot_08

 

One thought on “39. Matplotlib: Pie charts, and adding a title

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s