Adding Bar graph with another plot, convert the bar graph with a color axis, tittle in one figure?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to draw this Bar, but want to add color in the bar chart, title, axis, along with the bar graph want to add the original plot(curve) and legend. I am trying hold on command but it figure is not icking . Kindly tell me how to include all of them in one figure.
x = [0 0.2 0.4 0.7 0.8 1]; % start of bar y = zeros(length(x),1); dx = diff([x 1]); % width of bar dy = [1 5 7 9 3];
figure;
for ii=1:length(x) rectangle('position',[x(ii) y(ii) dx(ii) dy(ii)]) end
0 Commenti
Risposta accettata
Preethi
il 18 Gen 2017
hello,
hope this is helpful
x = [0 0.2 0.4 0.7 0.8 1]; % start of bar
y = zeros(length(x),1); dx = diff([x 1]); % width of bar
dy = [1 5 7 9 3];
figure;
bar([1,2,3,4,5,6],x,0.1,'y')
title('Name')
xlabel('x-label')
ylabel('y-label')
hold on
plot([0.1,0.2,0.4])
legend('bar','plot')
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots 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!