Clear Filters
Clear Filters

how to use cells as xlabel in stackedplot

5 views (last 30 days)
I have a matrix with 5 columns and the names of the variables as cells. I want to use the cells as the ylabels in the stackedplot. Can anyone help?

Accepted Answer

Adam Danz
Adam Danz on 21 Aug 2020
Edited: Adam Danz on 19 Nov 2020
First convert your matrix to a table and use the variable names in your cell array.
T = array2table(x, 'VariableNames', varNameArray);
stackedplot(T)
Also see the DisplayLabels property.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!