Cannot zoom into figures

54 vues (au cours des 30 derniers jours)
Justin Chan
Justin Chan le 3 Juil 2019
Commenté : Matthew Cooper le 11 Oct 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 commentaire
Flavv
Flavv le 5 Nov 2019
Modifié(e) : Flavv le 5 Nov 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.

Connectez-vous pour commenter.

Réponses (2)

Steven Lord
Steven Lord le 5 Nov 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 commentaires
Flavv
Flavv le 5 Nov 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 le 11 Oct 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.

Connectez-vous pour commenter.


Paul Macey
Paul Macey le 3 Déc 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.

Catégories

En savoir plus sur Visual Exploration dans Help Center et File Exchange

Tags

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by