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

1 回表示 (過去 30 日間)
Torkan
Torkan 2021 年 3 月 27 日
コメント済み: Torkan 2021 年 3 月 27 日
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 件のコメント
Torkan
Torkan 2021 年 3 月 27 日
I changed the code now run please

サインインしてコメントする。

回答 (1 件)

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

カテゴリ

Help Center および File ExchangeTesting Frameworks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by