App Designer Bar Plot doesnt reset X axis categories

10 ビュー (過去 30 日間)
Vasiliki Kosmidou
Vasiliki Kosmidou 2022 年 2 月 11 日
回答済み: Vasiliki Kosmidou 2022 年 2 月 12 日
Hello,
I am using the App Designer and the bar plot with the option "stacked" ie bar(app.myAxes,symbols,data,'stacked'). Unfortunatelly I cannot share my code/app.
The program updates the symbols and data at each iteration but the bar plot x-axis doesnt change (symbols/category names). The graphs do change reflecting the new data.
I believe there is a bug. I have tried literally everything.
cla(app.myAxes,"reset")
reset(app.myAxes)
app.myAxes.NextPlot = 'replaceall';
I also tried inserting a panel and making the axes dynamic. I even tried deleting the full panel and rebuilding it at each iteration.
delete(app.myPanel)
app.myPanel = uipanel(app.myTab);
app.myAxes = uiaxes(app.myPanel);
Any idea how to make the x-axis update/reset???
Thanks

採用された回答

Vasiliki Kosmidou
Vasiliki Kosmidou 2022 年 2 月 12 日
I figured it out. You need to use removecats(symbols) even if your new symbols do not contain the old ones.

その他の回答 (1 件)

yanqi liu
yanqi liu 2022 年 2 月 12 日
yes,sir,may be try
set(app.myAxes,'XTick',[]) or
app.myAxes.XTick = [];

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by