Как изменить формат даты на графике оси X в Rstudio? - PullRequest
1 голос
/ 03 мая 2020

Я бы хотел изменить формат даты и времени "% y-% m-% d% h:% m" на "% y-% m". потому что на сюжете показывают название дня недели

Я буду использовать повторение без реальных данных:

flow<-rep(5, times = 839)
rain<-rep(1, times = 839)
#### create the time serie with data each five minutes for to graph with df data
dates<-seq(from=as.POSIXct("2018-08-14 11:05:00"), to= as.POSIXct("2018-08-17 08:55:00") ,by="5 min")

#####Plot rainfall first and to solve the too large error
par(xaxs="i", yaxs="i", mar=rep(2,2))
plot(dates, rain, type="h", ylim=c(max(rain)*10,0),
     axes=FALSE, xlab=NA, ylab=NA, col="gray", 
     lwd=20, lend="square")
axis(4)
mtext("Precipitación", side=4, line=3)
#### Plot flow on top
par(new=TRUE)
plot(dates, flow, type="l", lwd=2, ylim=c(4, max(flow)*1.2), xlab = "Fecha", ylab =expression("Caudal (l/s)"), col="blue")

Мой сюжет:

enter image description here

Большое вам спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...