Created
March 25, 2013 16:27
-
-
Save mbacou/5238419 to your computer and use it in GitHub Desktop.
R: Export multiple graphs to PNG or SVG in one step
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export multiple graphs to PNG or SVG at once | |
png("/out/YieldTarget_%d.png") | |
dotplot(cropSPAM~value, | |
plot[!plot$cropSPAM %in% c("BANP", "SUGC"),], | |
group=variable, | |
main=list("Mean GAEZ Low and High Input Yield Potentials \nagainst Mean SPAM Yield", cex=.9), | |
xlab="yield (kg/ha)", | |
pch=c(1,1,3), | |
cex=1.2, | |
col=c("green", "red", "orange"), | |
key=list( | |
text=list(c("GAEZ low", "GAEZ high", "SPAM yield"), cex=.9), | |
points=list(pch=c(1,1,3), col=c("green", "red", "orange")), | |
space="right", | |
transparent=TRUE, | |
horizontal=TRUE) | |
) | |
bwplot(cropGAEZ~rl|ISO3, | |
gaez.y.norm[cropGAEZ %in% levels(cropGAEZ)[1:4]], | |
main=list("GAEZ Low and High Input Yield Potentials for South Asia", cex=.9), | |
xlab="yield (mT/ha)" | |
) | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment