フィルターのクリア

Bar figure helps with group on the x-axis

7 ビュー (過去 30 日間)
David
David 2022 年 8 月 25 日
編集済み: Voss 2022 年 8 月 26 日
Hello everyone, I need help with grouping my data, where the central value on the x-axis is the corresponding number, not approximations.
x = [1.2132312 5.3413413212];
vals = [1.12234 1.34234 0.52342741238 2.4132213 3.1231232 5.123123 8.123123;5.793371156 10.506158125 1.23213 1.3123 1.5 1.5 1.5]
vals = 2×7
1.1223 1.3423 0.5234 2.4132 3.1231 5.1231 8.1231 5.7934 10.5062 1.2321 1.3123 1.5000 1.5000 1.5000
b = bar(x,vals,'grouped');
For example, the group of 7 bars that comes out below only the number 1.2132312 and for the other set the number 5.3413413212

回答 (1 件)

Voss
Voss 2022 年 8 月 26 日
編集済み: Voss 2022 年 8 月 26 日
Like this?
x = [1.2132312 5.3413413212];
vals = [1.12234 1.34234 0.52342741238 2.4132213 3.1231232 5.123123 8.123123;5.793371156 10.506158125 1.23213 1.3123 1.5 1.5 1.5];
b = bar(x,vals,'grouped');
set(gca(),'XTick',x)
Or this?
b = bar(x,vals,'grouped');
ax = gca();
ax.XTick = x;
ax.XAxis.TickLabelFormat = '%.10f';
Or this?
b = bar(x,vals,'grouped');
ax = gca();
ax.XTick = x;
ax.XTickLabel = {'1.2132312' '5.3413413212'};

カテゴリ

Help Center および File ExchangeBar Plots についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by