x 軸の日付を 3 か月ごとに取得したいので、 を使用しますdate_breaks("3 month")
が、期間は 1/03 に開始し、1/1、1/4 などに移動させたいと考えています。
datos <- data.frame(fecha= date_decimal(seq(2013.0,2013.99,by=0.01)),val=runif(100,1,2))
fini <- ymd("20130101")
ffin <- ymd("20131231")
ggplot(data=datos) + geom_point(aes(x=fecha,y=val)) +
scale_x_datetime(breaks = date_breaks("3 month"),
limits=c(fini,ffin),
labels = date_format("%d-%m-%Y"))
また試しました:
ggplot(data=datos) + geom_point(aes(x=fecha,y=val)) +
scale_x_datetime(breaks = date_breaks("3 month"),
labels = date_format("%d-%m-%Y")) +
xlim(c(fini,ffin))
ただし、頭字語と必要な数字で月を取得します( xlim() は以前の scale_x_datetime() をキャンセルするように見えます)