Error when trying to use stackedplot with more than 1 y-value per plot

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

 채택된 답변

Tomas Bartkowski
Tomas Bartkowski 2023년 7월 30일

0 개 추천

Ok, I figured it out, sorry to have bothered.
The specific feature of stackedplot I was trying to use was incorporated into the function later, it works with MATLAB R2022b and later.

추가 답변 (1개)

dpb
dpb 2023년 7월 30일

1 개 추천

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

Thank you for your quick reply! Just figured it out myself a couple of minutes ago. Feel dumb now ;)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by