私はR-3.2.4を使用しています。 私はx軸上の時間とy軸上のいくつかの値でデータをプロットしようとしていましたが、x軸上で時間と共に日付を表示するたびにx軸上の時間間隔だけが必要です。ここで日付のないx軸にのみ時間間隔をプロットする方法はありますか?
は、私が使用していたコードである:ここでは
data_plot<- read.csv("C:/.../Data_pract.csv",header=TRUE,stringsAsFactors=F)
data_plot$Time<-as.POSIXct(strptime(data_plot$Time, format="%H:%M"))
mydata<-ggplot(data_plot,aes(x=Time,y=January))+geom_line()
mydata
は、私が使用しているサンプルデータです:
Time January
0:00 20
0:15 30
0:30 45
0:45 40
1:00 28
1:15 15
私は私が探していますことを、グラフの画像を添付しています。
ありがとうございます。 enter image description here
を使用してdatetime型にggplotにスケールを変更することができます。それを行う方法に関する多くの役に立つヒントは[ここにある](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)することができます。 –
['scale_x_date'](http://docs.ggplot2.org/current/scale_date.html)をご覧ください。 – Axeman
[ggplot2でスケール\ _x \ _日付の書式設定]の可能な複製(http://stackoverflow.com/questions/10576095/formatting-dates-with-scale-x-date-in-ggplot2) – Axeman