How can I change the axis in Matlab app designer?

Hi
I have a small problem. I have used swith on and off function on matlab appdesigner. I get the right values on my plot when I press switch on. But when the empy plot appears, I get valus for y axis that I dont want ( these are 0 to 1) , see the picture attached. How can I get rid of this default thing as my values that appear when I switch the button on, are between 0 and -300 (dependent on some criteria I have coded in the app designer) and that is what I want the plot to show also when it is empty.

1 件のコメント

Catalytic
Catalytic 2026 年 4 月 3 日
編集済み: Catalytic 2026 年 4 月 3 日
You have abandoned every single question you have ever posted, without accepting any of the answers or explaining to the contributor why the answer doesn't work. Please stop doing that.

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

回答 (1 件)

dpb
dpb 2026 年 3 月 23 日
移動済み: dpb 2026 年 3 月 23 日

0 投票

Afraid you're going to have to explain what the switch on and off does, specifically, unless it is simply toggling the 'Visible' property 'on','off'.
The default axis scaling is (and has always been) 0-1 on creation of an axis until data are present. If you want some specific range use ylim with that range first, before making the plot visible. Note you may also need to set hold on in order of it to "stick".

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

質問済み:

2026 年 3 月 23 日

編集済み:

2026 年 4 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by