From f0453b2bef5c9c30e6d650e2063294551a7022e0 Mon Sep 17 00:00:00 2001 From: Marianna Rottoli <marianna.rottoli@mail.polimi.it> Date: Mon, 6 Apr 2020 17:59:20 +0200 Subject: [PATCH] EDGE reporting scripts minor fixes. --- .../notebook_templates/EDGETransportComparison.Rmd | 7 ++++--- .../single/notebook_templates/EDGETransportReport.Rmd | 11 +++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/output/comparison/notebook_templates/EDGETransportComparison.Rmd b/scripts/output/comparison/notebook_templates/EDGETransportComparison.Rmd index 2fbe9e6..8f62197 100644 --- a/scripts/output/comparison/notebook_templates/EDGETransportComparison.Rmd +++ b/scripts/output/comparison/notebook_templates/EDGETransportComparison.Rmd @@ -48,6 +48,7 @@ cols <- c("NG" = "#d11141", "Trucks" = "#ff6a6a", "International Shipping" = "#cd2626", "Domestic Shipping" = "#ff4040", + "Truck" = "#ff7f50"; "Trucks (<3.5t)" = "#ff7f50", "Trucks (3.5t-16)" = "#8b0000", "Trucks (>16)" = "#fa8072", @@ -84,7 +85,7 @@ cols <- c("NG" = "#d11141", "Cons. + Synfuels" = "orchid", "Ctax_Conservative" = "#d11141") -legend_ord_modes <- c("Freight Rail", "Trucks (<3.5t)", "Trucks (3.5t-16)", "Trucks (>16)", "International Shipping","Domestic Shipping", "Trucks", +legend_ord_modes <- c("Freight Rail", "Truck", "Trucks (<3.5t)", "Trucks (3.5t-16)", "Trucks (>16)", "International Shipping","Domestic Shipping", "Trucks", "Motorbikes", "Small Cars", "Large Cars", "Van", "International Aviation", "Domestic Aviation","Bus", "Passenger Rail", "Freight", "LDV", "Pass non LDV", "Freight (Inland)", "Pass non LDV (Domestic)", "Non motorized") @@ -116,7 +117,7 @@ vintcomparisonpf = function(dt){ fill = technology, width=.75), alpha = 0.5, position="stack", stat = "identity", width = 0.5)+ geom_bar(data = dt, aes(x=scenario, y=value, group=interaction(variable, technology), - fill = technology, alpha = factor(alphaval), width=.75), position="stack", stat = "identity", width = 0.5, color = "black")+ + fill = technology, alpha = factor(alphaval), width=.75), position="stack", stat = "identity", width = 0.5, color = "black", size=0.05)+ guides(fill = guide_legend(reverse=TRUE))+ theme_minimal()+ facet_grid(year~region)+ @@ -215,4 +216,4 @@ EJmodeFUn = function(dt){ EJmodeFUn(EJmode_all) -``` \ No newline at end of file +``` diff --git a/scripts/output/single/notebook_templates/EDGETransportReport.Rmd b/scripts/output/single/notebook_templates/EDGETransportReport.Rmd index 6dbf3cd..fde3527 100644 --- a/scripts/output/single/notebook_templates/EDGETransportReport.Rmd +++ b/scripts/output/single/notebook_templates/EDGETransportReport.Rmd @@ -92,12 +92,12 @@ plotVint = function(vintcomp, newcomp, sharesVS1){ p = ggplot()+ - geom_bar(data = allfleet[year %in% c(2015,2030,2050)], + geom_bar(data = allfleet[year %in% c(2015, 2030, 2050, 2100)], aes(x=as.character(year),y=value, group=interaction(variable, technology), fill = technology), alpha = 0.5, position="stack", stat = "identity", width = 0.5)+ - geom_bar(data = allfleet[year %in% c(2015,2030,2050)], + geom_bar(data = allfleet[year %in% c(2015, 2030, 2050, 2100)], aes(x=as.character(year),y=value, group=interaction(variable, technology), - fill = technology, alpha = factor(alphaval)), position="stack", stat = "identity", width = 0.5, color = "black")+ + fill = technology, alpha = factor(alphaval)), position="stack", stat = "identity", width = 0.5, color = "black", size = 0.05)+ guides(fill = guide_legend(reverse=TRUE))+ theme_minimal()+ facet_wrap(~region, nrow = 4)+ @@ -105,7 +105,7 @@ plotVint = function(vintcomp, newcomp, sharesVS1){ axis.text = element_text(size=7), title = element_text(size=8), legend.text = element_text(size=8))+ - scale_x_discrete(breaks = c(2015,2030,2050))+ + scale_x_discrete(breaks = c(2015, 2030, 2050, 2100))+ scale_alpha_discrete(breaks = c(1,0), name = "Status", labels = c("Vintages","New additions")) + guides(linetype=FALSE, fill=guide_legend(reverse=FALSE, title="Transport mode"))+ @@ -188,7 +188,6 @@ intcompplotf = function(EF_shares, FV_shares, VS1_shares){ p = ggplot()+ geom_bar(data = shares_LDV[year<=2100 & year>=2025], aes(x=year,y=shareIS1, group = technology, fill = technology), alpha = 0.5, position = position_fill(), stat = "identity")+ geom_bar(data = shares_LDV[year<=2100 & year>=2025], aes(x=year,y=shareIS1, group = technology, fill = technology, alpha = type), position = position_fill(), stat = "identity")+ - facet_wrap("technology")+ theme_minimal()+ expand_limits(y = c(0,1))+ scale_fill_manual("technology", values = cols)+ @@ -498,4 +497,4 @@ CO2km_intensity_newsalesplotf = function(annual_sales, mj_km_data, sharesVS1, sh shares_source_liquids = miffile[variable %in% c("FE|Transport|Liquids|Biomass", "FE|Transport|Liquids|Coal", "FE|Transport|Liquids|Oil"),] CO2km_intensity_newsalesplotf(annual_sales, mj_km_data, sharesVS1 = shares$VS1_shares, shares_source_liquids) -``` \ No newline at end of file +``` -- GitLab