Error when trying to use stackedplot with more than 1 y-value per plot
Ältere Kommentare anzeigen
Initially I wanted to post my question concerning my own code, but I noticed that not even the corresponding examples seem to work.
stackedplot works fine with one table, but as soon as I try to incorporate a second table (with matching column names) to get 2 plots in the corresponding subplots, I get the error "Error using stackedplot (line 71) Variables to plot must be a valid data type." I tried to simplify the problem, even tried 2 identical tables, always the same error. So I tried the supplied examples, same behavior:

So - as not even the example works as expected, I started to suspect my MATLAB installation. I work on R2020b and tried to use a fresh install of R2018b, where the function was introduced. Same error on both installations.
Did somebody encounter this before? Might get back to subplots, if I can't figure this out.
Greetings
Tommy
Akzeptierte Antwort
Weitere Antworten (1)
dpb
am 30 Jul. 2023
1 Stimme
The feature to use multiple tables in stackedplot wasn't introduced until R2022b (see the "More About" section).
So, there's nothing wrong with earlier installs and there's no point in trying this route unless/until upgrade to at least R2022b. Seems a nice enhancement, but you're out of luck...
1 Kommentar
Tomas Bartkowski
am 30 Jul. 2023
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!