Advertisement
Skylighty

gantt_charts

Mar 30th, 2020
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2.  
  3. fig, gnt = plt.subplots()
  4.  
  5. #---------GRANICE OSI Y------------------
  6. gnt.set_ylim(0,75)
  7.  
  8. #----------GRANICE OSI X-----------------
  9. gnt.set_xlim(0,20)
  10.  
  11. #---------PODPIS OSI X-------------------
  12. gnt.set_xlabel('Time units [T]')
  13.  
  14. #---------PODPIS OSI Y-------------------
  15. gnt.set_ylabel('Process')
  16.  
  17. #---------SZEROKOŚCI NA OSI Y------------
  18. gnt.set_yticks([7,23,39,53,68])
  19.  
  20. #---------TICKI NA OSI X------------------
  21. gnt.set_xticks([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
  22.  
  23. #--------PODPISY NA OSI Y----------------
  24. gnt.set_yticklabels(['A','B','C','D','E'])
  25. #--------WŁĄCZ GRIDA---------------------
  26. gnt.grid(True)
  27.  
  28. #--------MODELOWANIE PASKÓW--------------
  29. #format : ([start_time,duration], (lower_y, height), facecolors=('tab:colours'))
  30. gnt.broken_barh([(0,3)],(0,15),facecolors=('tab:red'))
  31. gnt.broken_barh([(3,6)],(15,15),facecolors=('tab:orange'))
  32. gnt.broken_barh([(9,4)],(30,15),facecolors=('tab:blue'))
  33. gnt.broken_barh([(13,5)],(45,15),facecolors=('tab:green'))
  34. gnt.broken_barh([(18,2)],(60,15),facecolors=('tab:purple'))
  35.  
  36. plt.savefig('gantt1.png')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement