Advertisement
makispaiktis

Pie charts

May 24th, 2021 (edited)
894
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import numpy as np
  3.  
  4. vector = [4, 3, 2, 1]
  5. myLabels = ["Apples", "Pears", "Bananas", "Cherries"]
  6. y = np.array(vector)
  7.  
  8. plt.pie(y, labels = myLabels)
  9. plt.legend(title = "Number of each fruit")
  10. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement