1. import matplotlib.pyplot as plt
    2. # Fixing random state for reproducibility
    3. np.random.seed(19680801)
    4. # Compute pie slices
    5. N = 20
    6. theta = np.linspace(0.0, 2 * np.pi, N, endpoint=False)
    7. radii = 10 * np.random.rand(N)
    8. width = np.pi / 4 * np.random.rand(N)
    9. colors = plt.cm.viridis(radii / 10.)
    10. ax = plt.subplot(111, projection='polar')
    11. ax.bar(theta, radii, width=width, bottom=0.0, color=colors, alpha=0.5)
    12. plt.show()

    image.png