You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.1.1.post1111+gac2da0e
Fork me on GitHub

Related Topics

This Page

Pie chart on polar axisΒΆ

Demo of bar plot on a polar axis.

import numpy as np
import matplotlib.pyplot as plt

# Fixing random state for reproducibility

# Compute pie slices
N = 20
theta = np.linspace(0.0, 2 * np.pi, N, endpoint=False)
radii = 10 * np.random.rand(N)
width = np.pi / 4 * np.random.rand(N)

ax = plt.subplot(111, projection='polar')
bars =, radii, width=width, bottom=0.0)

# Use custom colors and opacity
for r, bar in zip(radii, bars):
    bar.set_facecolor( / 10.))

Gallery generated by Sphinx-Gallery