I see your data are durations along the x axis. To set the axis limits,
- Use xlim() where the first input is your axis handle and your 2nd input is a [1 x 2] vector of durations
- The 2nd value of your x limit must be larger than the first value
Here's a demo
h = duration([9 17 54;12 32 3]);
app.uiax = uiaxes();
plot(app.uiax,h,[0,1], '-o')
xstart = duration(9,0,0);
xend = duration(13,0,0);
xlim(app.uiax,[xstart, xend])
If your are plotting this : [c{range,1},range]
then you minimum and maximum durations would be
xstart = min([c{range,1},range]);
xend = max([c{range,1},range]);
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/492563-app-designer-axis-issue-xlim-and-dataticks#comment_770331
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/492563-app-designer-axis-issue-xlim-and-dataticks#comment_770331
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/492563-app-designer-axis-issue-xlim-and-dataticks#comment_771022
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/492563-app-designer-axis-issue-xlim-and-dataticks#comment_771022
Sign in to comment.