error bars on grouped barplot with 2 axis
Show older comments
Hello, I have the following barplot:
clear all
clc
close all
(Separated off the brute force clear/close so folks can download w/o fear of wiping their own workspace -- dpb)
set(groot,'defaultAxesTickLabelInterpreter','latex');
set(groot,'defaulttextinterpreter','latex');
set(groot,'defaultLegendInterpreter','latex');
a = [37.6 0; 29.9 0];
b = [0 1.4 ; 0 1.1 ];
a(:,2)=zeros;
b(:,1)=zeros;
yyaxis left;
bar(1:2,a);
ylim([0 40]);
yyaxis right;
bar(1:2,b);
ylim([0 2]);
set(gca,'XTickLabel',{'part 1';'part 2';'part 1';'part 2'})
yyaxis left
ylabel('time/s')
yyaxis right
ylabel('mean/mm')
I want to add errorbars for the blue bars belonging to the left axis and the same for the orange bars belonging to the right axis.

Accepted Answer
More Answers (0)
Categories
Find more on Errorbars in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!