Stack Bar Plot: length error between x and y

1 回表示 (過去 30 日間)
Deborah Johnson
Deborah Johnson 2023 年 1 月 10 日
コメント済み: Voss 2023 年 1 月 10 日
Hello, I am trying to do a stack plot per hour:min for 3 cities. I changed the datetime to only show HH:mm.
But now I am told there is a 'length issue' between x and y. I believe I understand but don't know
for sure. Do I need to change the datatype from double to single or something else? I was
able to do the stack plot in excel. Please assist.
Error using bar - X must be the same length as Y.
x = [Book1.PickupTime];
y = [Book1.Manhattan; Book1.LaGuardia; Book1.JFK];
bar(x, y, 'stacked')

採用された回答

Voss
Voss 2023 年 1 月 10 日
Try this:
x = Book1.PickupTime;
y = [Book1.Manhattan Book1.LaGuardia Book1.JFK];
bar(x, y, 'stacked')
  2 件のコメント
Deborah Johnson
Deborah Johnson 2023 年 1 月 10 日
Thanks!
Voss
Voss 2023 年 1 月 10 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBar Plots についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by