Hello,I am creating plots of hourly precipitation and accumulated precipitation (on different axis, see attached image). I was wondering how can I have the plot frame (black border) start at zero, it looks like it is plotted less than zero?
The code I use to create the png files is below:
CairoPNG(PNG_file,width=1000, height=600, pointsize=14, bg="white") opar <- par(mai = c(.8, .8, 1, .8)) # Set marginsplot(ppt,type="h",col="dark grey",ylim=c(0,max_ppt+1), lwd=6, xlab='', ylab='', main=title, frame.plot=T, axes=F)
axis(2, col="black", las=2) par(new=T) # R to overwrite the first plot plot(accum, type="l", col="blue", axes=F, ylab='', xlab='', lwd=2) axis(1, col="black", las=1) axis(4, pretty(c(0, max_accum) ), col="black", las=2)legend("topleft", legend=c('Incremental', 'Accumulated'), col=c("dark grey", "blue"), lwd=c(6, 2.0)) legend((length(n)-4),max_accum, legend=paste(round(max_accum,2)), bty="n", cex=.90) ### max accum location
mtext(paste("Lat:", .lat, "Lon:", .lon), cex=0.95) mtext("Index Hour", side=1, line=2) mtext("Incremental Precipitation (in)", side=2, line=2.5) mtext("Accumulated Precipitation (in)", side=4, line=2) dev.off() Thanks for all your help, Doug --------------------------------- Douglas M. Hultstrand, MS Senior Hydrometeorologist Metstat, Inc. Windsor, Colorado voice: 970.686.1253 email: dmhul...@metstat.com web: http://www.metstat.com ---------------------------------
<<inline: mass_curve_33.355-111.325_1147_Zone1.png>>
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.