Sub category plots in MATLAB?

I want to plot a graph with sub category. It should look something like the graph in the image.

Answers (1)

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

Categories

Find more on Graphics Performance in Help Center and File Exchange

Asked:

on 1 Dec 2020

Answered:

on 7 Dec 2020

Community Treasure Hunt

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

Start Hunting!