Cannot zoom into figures

46 visualizaciones (últimos 30 días)
Justin Chan
Justin Chan el 3 de Jul. de 2019
Comentada: Matthew Cooper el 11 de Oct. de 2020
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 comentario
Flavv
Flavv el 5 de Nov. de 2019
Editada: Flavv el 5 de Nov. de 2019
Same here with Matlab R2018b, it is impossible to zoom. My script was named "view.m". If I change its name, the zoom works.

Iniciar sesión para comentar.

Respuestas (2)

Steven Lord
Steven Lord el 5 de Nov. de 2019
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 comentarios
Flavv
Flavv el 5 de Nov. de 2019
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 el 11 de Oct. de 2020
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.

Iniciar sesión para comentar.


Paul Macey
Paul Macey el 3 de Dic. de 2019
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.

Categorías

Más información sobre Visual Exploration en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by