error bars on grouped barplot with 2 axis
显示 更早的评论
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.

采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Errorbars 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
