How can I create a stacked bar graph with the following chart?

2 次查看(过去 30 天)
A three by four table with categorical and numberic variables. Goal is to combine two categorical variables into one plot variable alongside the results. Example table is typed below:
Fastball Ball 10
Curveball Strike 15
Fastball Strike 20
Curveball Ball 25

采纳的回答

Sulaymon Eshkabilov
A = {'Fastball_{Ball}'; 'Curveball_{Strike}'; 'Fastball_{Strike}'; 'Curveball_{Ball}'}; A = categorical(A);
C = [10;15;20;25];
T = table(A); T.C=C; bar(T.A, T.C); %pie(T.A, T.C)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Networks 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by