Limiting UIAxes Interactivity in AppDesigner

45 ビュー (過去 30 日間)
Veena Chatti
Veena Chatti 2020 年 9 月 12 日
コメント済み: Adam Danz 2022 年 8 月 25 日
Hi!
I'm using three UIAxes to display plots, and I'd like to be able to limit their interactivity such that the zoom in/out, and save/export buttons neither appear nor work. Are there commands to enable/disable these in AppDesigner?
Thanks in advance for your suggestions!

採用された回答

Adam Danz
Adam Danz 2020 年 9 月 13 日
編集済み: Adam Danz 2020 年 9 月 13 日
The first line below turns off default interactivity and the second line turns off the toolbar options.
disableDefaultInteractivity(app.UIAxes)
app.UIAxes.Toolbar.Visible = 'off';

その他の回答 (2 件)

Mario Malic
Mario Malic 2020 年 9 月 12 日
編集済み: Mario Malic 2020 年 9 月 13 日
I am not aware of the option to save/export fig in App Designer.
For limiting interactivity:
ax = app.UIAxes; % change to your UIAxes handle
ax.Interactions = [panInteraction];
ax.Toolbar.Visible = 'off';
  7 件のコメント
Mario Malic
Mario Malic 2020 年 9 月 13 日
I sourced my information from UIAxes properties which also mentioned disableDefaultInteractivity, but didn't checked it.
"I enjoy and learn from other people's approaches such as this one." - Likewise!
Veena Chatti
Veena Chatti 2020 年 9 月 22 日
Thank you both for your inputs! I found that Adam's answer worked!

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


Bruno Gonfiotti
Bruno Gonfiotti 2020 年 9 月 18 日
I tested the solutions here proposed, but in Matlab 2020b I get the following error: Invalid or deleted object. Error in disableDefaultInteractivity (line 12). ax.InteractionContainer.Enabled = 'off';
Do you have any suggestion?
  8 件のコメント
Ioannis
Ioannis 2022 年 8 月 24 日
移動済み: Adam Danz 2022 年 8 月 25 日
How can I use disableDefaultInteractivity for all the functions?
Adam Danz
Adam Danz 2022 年 8 月 25 日
@Ioannis, can you explain what you mean by "functions"? Do you mean interactions? What interactions still existed after executing disableDefaultInteractivity?

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

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by