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 CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by