2016-09-09 28 views
1

グラフに%m /%d /%Yとしてタイムスタンプを印刷する方法はありますか?短い(< 7日間)のデータが次のような曜日として印刷されますか?時系列プロットのX軸ラベルフォーマットの制御 - R

plot(station_171$datetime, station_171$stageheight, pch=ifelse(station_171$outcode ==122,24,21), col="black", bg=ifelse(station_171$outcode ==122,"red","NA") 
    , xlab = "",xlim = c(min(station_101_7$datetime),max(station_101_7$datetime)), ylab = "") 
legend("topright","171", bty = "n", cex=2) 

enter image description here

答えて

1

下図のようにあなたがaxis.POSIXctを使用して軸の書式を設定することができます

axis.POSIXct(1,station_171$datetime, format = '%Y-%m-%d %H:%S') 

一つもx軸を印刷し、二重避けるために、関数plotでxaxt='n'が含まれていることを確認すべきです軸のラベル。

関連する問題