Filter löschen
Filter löschen

If I have day month and Year in Xaxis, How can apply limit to the Xaxis?

2 Ansichten (letzte 30 Tage)
I want to Plot the data for every month and year, so How can i apply the xlimit?

Akzeptierte Antwort

Star Strider
Star Strider am 22 Mär. 2022
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 Kommentare
Meghraj Kc
Meghraj Kc am 23 Mär. 2022
Thank you for the help!!
I understood and applied to my code.
Thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Formatting and Annotation finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by