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