AppDesigner - images intermittently not rendering during pan/zoom + other poor behavior
6 views (last 30 days)
Show older comments
Daniel Plotnick
on 24 Mar 2021
Commented: Vitek Stepien
on 27 Sep 2023
Hello,
(Matlab 2020b) I am having an issue where images or data plotted using image, imshow, or imagesc will behave very poorly during pan/zoom in an app built using AppDesigner (so in a UIFigure + UIAxes). These issues include -
- Vanishing entirely after pan/zoom: Resizing the figure window sometimes fixes this, reset view (home button) sometimes fixes it, another pan/zoom sometimes fixes it, and sometimes it the image just wont render until I have done some combination of the above.
- Vanishes intermittently during pan: unlike in a regular figure+axes, the plot will flicker midway through a pan operation, sometimes coming back as I continue to pan, and sometimes not.
- XLim/YLim hopping after pan/zoom: after releasing the pan or zoom (buttonUp on the mouse) the axis limits will often hop around several times. It looks like there are several automatic resizing callbacks that are getting in each others way, but I don't know that for sure. It is especially bad if I had alread started another panning operation.
This makes it very difficult to imagine building a professional quality app that involves image display with pan/zoom allowed. Some other notes:
- This seems to get worse with larger images. However, I have managed to replicate the behavior with very modest image sizes.
- I have replicated this on two machines using different hardware.
- I have tried flipping every switch I can think of in UIAxes - interruptable, nextplot, busyaction, plotboxaspectratio, etc. and even switched the renderer to opengl- no joy.
- These problems are not present when using a regular figure + axes. If I could child a plain axes to a uifigure I would, but I cannot.
I cannot copy/paste the app code, but the quickest way to try to replicate this is to:
- Create a new app in appdesigner
- Add an Axes to the app
- Modify the startupFcn to read:
img = rand(1000,4000); % large so its easy to see the issue
imagesc(app.UIAxes,img);
axis(app.UIAxes, 'equal')
4. Start panning and zooming to see these issues
Any solution that fits "I want to smoothly pan and zoom an image plot within a Matlab app, without rendering issues" is welcomed. I just cannot fathom how the pan/zoom and general axes functionality is so much worse in the appdesigner and UIAxes than in normal Matlab figures.
Cheers,
-Dan
3 Comments
Adam Danz
on 2 Apr 2021
You have to fill in the Product first before the release field becomes enabled. I've mentioned this stumbling block to developers in the past so they are aware of it, but thanks for explaining.
And thanks for the update to confirm that r21a fixed it for you.
Accepted Answer
Daniel Plotnick
on 2 Apr 2021
6 Comments
Vitek Stepien
on 27 Sep 2023
Hi, sorry but nothing from - my solution will be to upgrade to 23B soon ;)
More Answers (0)
See Also
Categories
Find more on Develop uifigure-Based Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!