Plot Numeric values vs Date&Time

2 ビュー (過去 30 日間)
pr
pr 2015 年 1 月 28 日
コメント済み: Star Strider 2015 年 1 月 28 日
The text files contains Date&Time and some values. Please look in the attachments. I need to plot Second column with Date&Time. I see that the plot is random not as I needed. Here is the code I wrote:
fid = fopen(filename,'r');
Data = textscan(fid,'%s %s','Headerlines',1,'delimiter','\t');
fclose(fid);
DT = datenum(Data{1});
y = cellfun(@str2double,Data{2});
plot(DT,y,'-*');
datetick('x','dd.mm.yyyy HH:MM');
I cannot even see the right Date and Time on x axis. How can I make it clearly visible to the users? Is there any way to display xtick vertically?

採用された回答

Star Strider
Star Strider 2015 年 1 月 28 日
No attachments yet.
You can display the XTickLabel values vertically in R2014b using ordinary plot commands. In earlier versions, you have to use the text function with the 'XTick' property governing the positions of the values, then rotate them to whatever angle you need.
  4 件のコメント
pr
pr 2015 年 1 月 28 日
編集済み: pr 2015 年 1 月 28 日
Thanks for the answer. I found a way to rotate the Xtick.
Star Strider
Star Strider 2015 年 1 月 28 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by