How to zoom in/out on the figures in app designer
58 次查看(过去 30 天)
显示 更早的评论
I cannot find the method for adding an toolbar with function of zoom in/out in the app designer, if it is not been supported now?
1 个评论
Blanca Larraga
2018-5-28
移动:Adam Danz
2023-6-14
Is there any option to just apply the zoom option to one of the two axis? Thank you very much in advance.
Best regards, Blanca
采纳的回答
更多回答(4 个)
Mirek Janda
2018-4-16
编辑:Mirek Janda
2018-4-18
You can try this:
pan(app.UIAxes,'on'); zoom(app.UIAxes,'on');
Then create a button to get the zoom 'off' and reset the axis:
zoom(app.UIAxes,'off'); app.UIAxes.XLimMode = 'auto'; app.UIAxes.YLimMode = 'auto';
3 个评论
craq
2018-7-27
Sure. In standard matlab I can do this:
figure
plot(1:10)
drawnow
zoom(gca,'on') %start zoom mode
keyboard
%click, zooms in
zoom(gca,'out') %zooms out
keyboard
%check that figure is zoomed out
zoom(gca,'off') %exit zoom mode
If I have an axes in appdesigner, I can do
zoom(app.UIAxes, 'on')
%now clicking/scrolling in the figure will zoom in
zoom(app.UIAxes, 'off')
but not
>> zoom(app.UIAxes, 'out')
Error using matlab.ui.control.UIAxes/togglemode
Unknown action character vector.
Chris Portal
2016-4-10
Unfortunately, App Designer does not offer support for adding a toolbar at this time.
2 个评论
Luciano Junior
2018-1-9
Try to build your on zoom ;) Once your figure is ploted, add an edit field (here you should insert the specific area in your figure to where you want to zoom) after add a slider to control the zoom (the slider values should control your Xlim) add a callback to the slider in order to plot the figure again (use the same code you used to plot the figure but now use the edit field and the slider values to control your XLim) everytime you change the slider value your figure will be updated.
Good luck!
Ana Gonçalves
2022-5-19
Make sure to check if the 'PickableParts' and 'HitTest' are set like in this picture. This solved my problem, hope that it solve yours too.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!