Remove the gaps between the bars in matlab without changing the width of the bars

1 次查看(过去 30 天)
Hello,
How can I do that?
clear all,
close all,
Zigma_nohole = [882,873,860];
Zigma_1hole = [523,540,545];
Zigma_2H0 = [393,355,358,352];
Zigma_2H45 = [389,360,365,376];
Zigma_2H90 = [580,540,545,547];
Avg_nohole = mean (Zigma_nohole);
Avg_1hole = mean (Zigma_1hole);
Avg_2H0 = mean (Zigma_2H0);
Avg_2H45 = mean (Zigma_2H45);
Avg_2H90 = mean (Zigma_2H90);
AVG_ALL = [Avg_nohole,Avg_1hole,Avg_2H0,Avg_2H45,Avg_2H90];
std_nohole = std (Zigma_nohole);
std_1hole = std (Zigma_1hole);
std_2H0 = std (Zigma_2H0);
std_2H45 = std (Zigma_2H45);
std_2H90 = std (Zigma_2H90);
STD_ALL = [std_nohole,std_1hole,std_2H0,std_2H45,std_2H90];
y = [ Avg_nohole; Avg_1hole; Avg_2H0; Avg_2H45; Avg_2H90];
bh = bar(1:5,diag(y),0.5,'stacked','FaceColor', 'c');
bh(1).FaceColor = 'r';
bh(2).FaceColor = 'b';
bh(3).FaceColor = 'g';
bh(4).FaceColor = 'k';
bh(5).FaceColor = 'y';
legend('Nohole','1hole','2H0','2H45','2H90')
hold on
h = errorbar(1:5,AVG_ALL,STD_ALL, '.');
ylabel('Tensile Strength (MPa)')
  3 个评论

请先登录,再进行评论。

回答(1 个)

Torkan
Torkan 2021-3-27
Could you please share with me? I want to reduce the width actually btw

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by