python pie chart
import matplotlib.pyplot as plt labels = ['Python', 'C++', 'Ruby', 'Java'] sizes = [215, 130, 245, 210] # Plot plt.pie(sizes, labels=labels, autopct='%1.1f%%', shadow=True, startangle=140) plt.axis('equal') plt.show()
Source: pythonspot.com
pie plot in python
title = plt.title('What slows down my computer') title.set_ha("left") plt.gca().axis("equal") pie = plt.pie(total, startangle=0) labels=["Trojans", "Viruses", "Too many open tabs", "The anti-virus software"] plt.legend(pie[0],labels, bbox_to_anchor=(1,0.5), loc="center right", fontsize=10, bbox_transform=plt.gcf().transFigure) plt.subplots_adjust(left=0.0, bottom=0.1, right=0.45)
Source: stackoverflow.com