App Designer Multiple Plots

I am trying to plot a bar graph and a line graph on the same axes in app designer. I know that there is an "add" property. However, I am not sure how to use it.
Please help.
Thanks
April

回答 (1 件)

Elizabeth Reese
Elizabeth Reese 2017 年 9 月 11 日

6 投票

Hi April,
You can use the hold command as you usually would to plot multiple graphs on an axes. You will need to call hold with the axes as an input. Say I had an axes in my app called UIAxes, then the code for overlaying a line and bar graph could look like the following:
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];
bar(app.UIAxes,y);
hold(app.UIAxes);
plot(app.UIAxes,y,'*');

1 件のコメント

April Bryan
April Bryan 2017 年 9 月 11 日
Hi Liz,
Thank you very much. The solution works well!
Regards,
April

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

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

質問済み:

2017 年 9 月 8 日

コメント済み:

2017 年 9 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by