Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated cropland_plots script with added features #15

Merged
merged 1 commit into from
Sep 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scripts/output/single/cropland_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ if(!dir.exists(file.path(outputdir,destplots))){
} else {writeLines(paste0("\nPlots will be saved in directory: ",destplots,"\n"))}

model <- read.magpie(paste0(outputdir,"/",destfile))

## Only cropland, no diff
writeLines(paste0("\n Plotting cropland .....\n"))
yr_to_plot <- c("y2050","y2100")
for(yr1 in yr_to_plot){
plotmap2(model[,yr1,"Cropland"],file = paste0(outputdir, "/", destplots, "/", "Cropland_",yr1, ".png"),lowcol = "red",midcol = "white",highcol = "green",midpoint = 0,title = paste0("Cropland in ",yr1),sea = FALSE,text_size = 30,legendname = "Change in mha.",plot_height = 18,plot_width = 36)
dev.off()
}

## All land types, diff with first year
for (i in getNames(model)) {
var=i
yrs <- getYears(model)
Expand Down