How do I plot Gantt Chart for scheduling?
    55 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Abdullah Türk
 il 10 Gen 2023
  
    
    
    
    
    Commentato: Adam Danz
    
      
 il 19 Dic 2023
            Hello everyone,
I have following matrix including task start and finish time for scheduling. 
task	start	    finish
1	    0	        410
2	    410	        600
3	    600	        803
4	    803	        1425
5	    600	        950
6	    0	        653
7	    653	        1970
8	    1970	    3050
9	    3050	    3406
10	    3406	    3778
11	    3778	    4192
12	    4192	    4693
13	    4693	    5353
14	    3050	    4572
15	    5353	    5452
16	    5452	    7648
How can I plot start and finish time for each task?
0 Commenti
Risposta accettata
  Adam Danz
    
      
 il 10 Gen 2023
        
      Modificato: Adam Danz
    
      
 il 10 Gen 2023
  
      You could create your own Gantt chart by building on this quick demo below.
Demo: Matrix version
data = [% task, start, finish
1	    0	        410
2	    410	        600
3	    600	        803
4	    803	        1425
5	    600	        950
6	    0	        653
7	    653	        1970
8	    1970	    3050
9	    3050	    3406
10	    3406	    3778
11	    3778	    4192
12	    4192	    4693
13	    4693	    5353
14	    3050	    4572
15	    5353	    5452
16	    5452	    7648];
width = .75; % vertical width of horizontal bars
ypairs = data(:,1) + width./[-2,2];
y = repelem(ypairs,1,2);
x = data(:,[2,3,3,2]);
patch(x',y','b')
grid on
set(gca,'YDir','Reverse')
Demo: Table version
T = array2table([
1	    0	        410
2	    410	        600
3	    600	        803
4	    803	        1425
5	    600	        950
6	    0	        653
7	    653	        1970
8	    1970	    3050
9	    3050	    3406
10	    3406	    3778
11	    3778	    4192
12	    4192	    4693
13	    4693	    5353
14	    3050	    4572
15	    5353	    5452
16	    5452	    7648], ...
'VariableNames', {'Task','Start','Finish'});
width = .75; % vertical width of horizontal bars
ypairs = T.Task + width./[-2,2];
y = repelem(ypairs,1,2);
x = [T.Start, T.Finish, T.Finish, T.Start];
patch(x',y','b')
grid on
set(gca,'YDir','Reverse')
8 Commenti
  Alfonso Rodriguez
 il 18 Dic 2023
				Amazing code for a project managment class for engineers who are adapting to Matlab.
Più risposte (1)
  Muhammad Raza
 il 23 Set 2023
        Here in this article, enough details available about how to plot gantt chart using MATLAB, take a look.
0 Commenti
Vedere anche
Categorie
				Scopri di più su Labels and Annotations in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

