If I have day month and Year in Xaxis, How can apply limit to the Xaxis?
2 次查看(过去 30 天)
显示 更早的评论
I want to Plot the data for every month and year, so How can i apply the xlimit?
0 个评论
采纳的回答
Star Strider
2022-3-22
If ‘x’ is a datetime array, the arguments to xlim must also be datetime values —
x = datetime('now')+days(0:60);
y = sin(2*pi*5*(0:numel(x)-1)/numel(x));
figure
plot(x,y)
grid
title('Original')
figure
plot(x,y)
grid
xlim([datetime('12-Apr-2022') datetime('12-May-2022')])
title('With ‘xlim’')
.
8 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calendar 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!