Cannot zoom into figures

60 ビュー (過去 30 日間)
Justin Chan
Justin Chan 2019 年 7 月 3 日
コメント済み: Matthew Cooper 2020 年 10 月 11 日
I am running Matlab 2019a on Ubuntu 18.04.2.
I am simply trying to zoom into an ordinary figure, such as one produced by plotting random numbers:
figure
plot(randi([-5,5],1000,1));
When I run the script, the figure pops up.
I can select the zoom tool.
However, when I attempt to drag the zoom tool to create a bounding box, no box forms. And thus no zoom occurs. I am also unable to use the pan tool. However, the 'data tips' and 'data brush' tools work.
This has occured recently, I am not sure what has changed in my setup to have caused this.
I previously has Matlab 2018b, but the zoom has also spontaneously stopped to work. So I upgraded to Matlab 2019a. But the zoom still does not work.
As a result, I suspect there is something related to the underlying system that is causing this. I know this is not related to OS version, as zoom worked before on this same OS. Any ideas?
  1 件のコメント
Flavv
Flavv 2019 年 11 月 5 日
編集済み: Flavv 2019 年 11 月 5 日
Same here with Matlab R2018b, it is impossible to zoom. My script was named "view.m". If I change its name, the zoom works.

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

回答 (2 件)

Steven Lord
Steven Lord 2019 年 11 月 5 日
Flavv,
The name view already has a meaning in MATLAB. The zoom function (which is called when you use the zoom button in the Figure window) does call view so your shadowing of this function could cause it to stop working if your view behaves differently than the view function included in MATLAB.
My suspicion is that between the last time it worked for Justin Chan and the first time it failed Justin introduced a script or function named view, zoom, or a similar function that shadows the version of that function included in MATLAB.
  2 件のコメント
Flavv
Flavv 2019 年 11 月 5 日
Hi Steven, thank you for your answer. Yes, this is very possible!
However this is clearly a bug: the user is supposed to be free to choose any name for his scripts (or at least be warned of a naming problem when running the script).
Matthew Cooper
Matthew Cooper 2020 年 10 月 11 日
Steven Lord's solution solved my problem. I had a function 'view'. When I removed it from my path, the zoom and pan tools worked again.

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


Paul Macey
Paul Macey 2019 年 12 月 3 日
I found this problem occurs in debug mode, when I also can't edit axes or save. I'm not sure if this is the same as earlier versions or not.

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by