how to use cells as xlabel in stackedplot

1 Ansicht (letzte 30 Tage)
Viktor G.
Viktor G. am 21 Aug. 2020
Bearbeitet: Adam Danz am 19 Nov. 2020
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?

Akzeptierte Antwort

Adam Danz
Adam Danz am 21 Aug. 2020
Bearbeitet: Adam Danz am 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.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by