- Have them use the axes toolbar. It already contains tools for zooming in and out.
- Have them enter the dates somehow, then use those to set the XLim properties of your axes
- Add 2 sliders, one that sets the min XLim value, and on to set the max XLim value
Making a GUI to zoom in on x-axis range
3 次查看(过去 30 天)
显示 更早的评论
I am looking to make a GUI where the user for this program can specify a range such as June to August and it will zoom in on that range? Is this possible? Any examples are appreaciated
0 个评论
回答(2 个)
Cris LaPierre
2020-8-3
编辑:Cris LaPierre
2020-8-3
A few options I can think of.
0 个评论
Arthur Roué
2020-8-3
Then refresh XLim property of your axes in uidatepicker ValueChangedFcn callback.
Here some lines to begin with
% Figure handle
hFig = uifigure()
% Axe handle
hAx = uiaxes(hFig, )
% Create date picker
hDatePicker = uidatepicker(hFig, 'ValueChangedFcn', @yourCallback);
function yourCallback(src, evt)
hAx.XLim = ..
end
2 个评论
Arthur Roué
2020-8-3
Any property that you want to change. Here see documentation uiaxes
hAxe = uiaxes(parent, 'Property', Value)
另请参阅
类别
在 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!