MATLAB Answers

I want to have different colors bars also I want to show the error bars from highest to lowest like what I have in the code. Then, I want to have the first two columns bar together then space between the other two columns bars. Please it is urgent

1 view (last 30 days)
Mazen Kiki
Mazen Kiki on 4 May 2021
Answered: Cris LaPierre on 4 May 2021
x = 1:4
data=([0.2022;0.2020; 0.2128; 0.2125])';
errhigh= [0.0044 0.0055 0.0035 0.0049]; % lower error bar position
errlow = [0.0030 0.0094 0.0045 0.0029]; % upper error bar position
% % draw error bar from minimum value to maximum value
bar (x,data)
hold on
%
er = errorbar(x,data,errlow,errhigh);
%
er.Color = [0 0 0 ];
er.LineStyle = 'none';
hold off

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by