PLOTTING BAR GRAPHS with different colors
Ältere Kommentare anzeigen
I have data stored in an array A from 1 to 400: A[1] =0, A[2]= 66.56, A[3]= 64.8, A[4]=56.8.....A[10] = 54.3, A[11]=73.3 ......... A[400] = 76.5
I wish to plot a bar graph in such a manner A[1] to A[10] in red color and A[11] to A[400] in blue color in a same graph. Can any one help me in this?
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 22 Nov. 2021
N = 10;
bar(x(1:N), y(1:N), 'r');
hold on
bar(x(N+1:end), y(N+1:end), 'b');
hold off
Kategorien
Mehr zu Discrete Data Plots finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


