How to set X axis to particular time frame on Matlab plot?

I've created a plot for a timeseries data using a timetable dataframe in matlab. However it is displaying the whole of the time series when I only want to display from the beginning of 1885 to the end of 1999 on the x axis. I've attached my current plot for reference.

3 件のコメント

Mathieu NOE
Mathieu NOE 2021 年 3 月 24 日
hello again !
I suppose you mean 1985 and not 1885
have you tried to force the xaxis within these limits ?
add this code after the plot :
set(gca,'XLim',[datetime(1985,01,01) datetime(2000,01,01)])
Elizabeth Lees
Elizabeth Lees 2021 年 3 月 24 日
Hi! Thank you so much! You've been a life saver! Maybe super cheeky but I have one other question on my page and you seem very skilled in MATLAB so you may be able to help me their its regarding calculating Pearsons Correlation and Nash-Sutcliffe coefficient.
Mathieu NOE
Mathieu NOE 2021 年 3 月 25 日
hello
I'll be happy to further help you within the limits of my competences !
for the Pearsons Correlation topic, I see someone has already provided a good answer about how to get rid of the NaN values that causes the trouble
for the Nash-Sutcliffe coefficient, could you share the data ? maybe do it ith the right post , not here

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

製品

リリース

R2018a

質問済み:

2021 年 3 月 23 日

コメント済み:

2021 年 3 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by