Advertisement
vacendak

Pie Chart

Sep 21st, 2020
1,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import numpy as np
  3.  
  4.  
  5. Z = np.full(19, 1)
  6. Z = list(Z)
  7. Z.append(2)
  8. explode = np.full(19, 0.05)
  9. explode = list(explode)
  10. explode.append(0.1)
  11. _, fig1 = plt.subplots(figsize=(10, 6))
  12. theme = plt.get_cmap('Greys_r')
  13. fig1.set_prop_cycle("color", [theme(1. * i / len(Z)) for i in range(len(Z))])
  14. plt.pie(Z, explode=explode, wedgeprops={'edgecolor': 'black', 'radius': 1.4})
  15. plt.show()
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement