Sub category plots in MATLAB?

9 次查看(过去 30 天)
vidit kedia
vidit kedia 2020-12-1
I want to plot a graph with sub category. It should look something like the graph in the image.

回答(1 个)

Shubham Khatri
Shubham Khatri 2020-12-7
Hello,
Please take a look at the following code
example = readtable('example.CSV');
example = sortrows(example,'Group');
h = bar(table2array(example(:,3:6)),'stacked');
set(gca,'xticklabel',table2array(example(:,2)));
Also please take a look at this answer
Hope it helps

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by