1
I’m trying to plot a graph with 3 sets of data. " Precipitation" and "Evapotranspiration" have high values (from 5 to 580) so would use the same scale in Y (on the left side) for both plotted data superimposed on line graph. The data of "Rainy days" (ranging from 3 to 28), I want to plot in the same graph but with a proper Y scale (on the right side).
I tried to:
plot(etp,type="l",ylim=c(5,580),col="turquoise",ylab="pluviosidade",xlab="mês)
lines(prec,col="turquoise3")
abline(v=seq(1,121,12),lty=2, col="gray")
lines(dcch,type="l",lwd="2",mar=c(5,4,2,5),ylim=c(3,28),col="darkorchid3",ylab="dias com chuva",xlab="mês")
axis(side=4,ylim=c(3,28),line=3,ylab="dias com chuva")
And I tried too:
plot(etp,type="l",ylim=c(5,580),col="turquoise",ylab="pluviosidade",xlab="mês")
lines(prec,col="turquoise3")
lines(dcch,type="l",lwd="2",col="darkorchid3")
abline(v=seq(1,121,12),lty=2, col="gray")
par(new=TRUE)
axis(side=2,ylim=c(5,580))
axis(side=4,ylim=c(0,30))
Where is the error?
make your data set, or a part of it, available with the command
dput
for your problem to be reproducible– Rafael Cunha