Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # python -m pip install -U pip
- # pip install matplotlib
- import matplotlib.pyplot as plt
- #change these main
- labels = ['name 1','name 2','name 3']
- sizes = [30, 20, 50] #needs to = 100
- colors = ['blue','orange','green']
- #change these if need
- plt.pie(sizes, labels=labels, colors=colors, wedgeprops={'width': 0.4})
- centre_circle = plt.Circle((0, 0), 0.65, color='white',
- fc='white', linewidth=1.25)
- plt.gca().add_artist(centre_circle)
- plt.axis('equal')
- plt.title('data chart test')
- plt.savefig("chart.png", dpi=300, bbox_inches='tight')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment