Skip to content
Prev 377145 / 398502 Next

date and time data on x axis

Hello,

Maybe you could get some inspiration in the following code.


op <- par(mar = c(4, 0, 0, 0) + par("mar"))

plot(xdata, ydata, type = "o", xaxt = "n")
axis.POSIXct(1, xdata, at = xdata, labels = xdata, las = 2)

par(op)


The important part is the call axis.POSIXct, argument las = 2 and the 
call to par is to make sure that the labels are visible.


Hope this helps,

Rui Barradas


?s 15:16 de 28/10/2018, snowball0916 escreveu: