Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. tov_type count
  2. Inpatient 7
  3. Office Visit 6
  4. Appointment Schedule 1
  5. Allergy Sheet 1
  6.  
  7. def addPieGraph():
  8. # Create a list of colors (from iWantHue)
  9. colors = ["#6287da","#72ac5c","#8653aa","#bb7438","#b94b75"]
  10.  
  11. # Create a pie chart
  12. plt.pie(
  13. # using data total)arrests
  14. custpref['cnt'],
  15. # with the labels being officer names
  16. labels=custpref['tov_type'],
  17. # with no shadows
  18. shadow=False,
  19. # with colors
  20. colors=colors,
  21. # with the start angle at 90%
  22. startangle=90,
  23. )
  24.  
  25. # View the plot drop above
  26. plt.axis('equal')
  27.  
  28. # View the plot
  29. plt.tight_layout()
  30. plt.title("Top 5 Visit Types Total = 15 Visits")
  31. plt.savefig(r"PieChart.png",bbox_inches="tight")
  32. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement