I am using base plot to create a graphic showing two graphs (temperature and relative humidity) with two y axis and one common x axis showing the time. I limited the x axis from 0 to 24 so it is showing the hours of the day. My problem here is that the numbers shown on the x axis only range from 0 to 20 in steps by 5 but i want to show the numbers in steps by 3 ending by 24, in order to get a nice time axis from 0 to 24.
How can i set the X-Axis to look like this?
This is my plot
This is the code I used so far:
### Plot 1
d1 = data.frame(Uhrzeit =D.Log.1t$Uhrzeit,
Temperatur = D.Log.1t$Temperatur,
rH = D.Log.1r$RH)
par(mar = c(5,5,5,5))
with(d1, plot(Uhrzeit, Temperatur, type="l", col="red3",
ylim=c(0,40), xlim=c(0,24)))
par(new = T)
with(d1, plot(Uhrzeit, rH, axes=F, type="l", col="blue",
ylim=c(0, 100)))
axis(side = 4)
mtext(side = 4, line = 3, 'rH')
par(mar=c(5.1, 14, 4.1, 8.1), xpd=TRUE)
legend("top", inset=c(0,-0.2), legend=c("Temperatur in °C","rH in %"), lty=c(1, 1), col=c("red3", "blue"))