From 32ae8c79d3b3d64156c19e46074e02ccbe3dec6d Mon Sep 17 00:00:00 2001 From: Alex Gebben Work Date: Wed, 29 Apr 2026 15:12:26 -0600 Subject: [PATCH] Updates to figures small tweaks --- REMI_Inputs.r | 10 +++++----- Visuals.r | 23 +++++++++++++---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/REMI_Inputs.r b/REMI_Inputs.r index 239d366..13b4c1c 100644 --- a/REMI_Inputs.r +++ b/REMI_Inputs.r @@ -111,16 +111,16 @@ ALL_VALUES <- DOLLAR_VALUES ALL_VALUES$POWER_OPERATORS <- POWER_OPERATORS -OP_PLOT <- ggplot(REG_DATA,aes(x=Capacity,y=log(Emp)))+geom_point()+geom_smooth(method='lm',color="orange")+theme_bw()+ylab("Operating Employment (Natural Log)" )+scale_x_continuous(breaks=seq(0,5000,by=250),labels = scales::comma)+scale_y_continuous(breaks=seq(0,7,by=0.25))+theme(text=element_text(size=20))+xlab("Capacity (MW)") +OP_PLOT <- ggplot(REG_DATA,aes(x=Capacity,y=log(Emp)))+geom_point()+geom_smooth(method='lm',color="orange")+theme_bw()+ylab("Operating Employment (Natural Log)" )+scale_x_continuous(breaks=seq(0,5000,by=500),labels = scales::comma)+scale_y_continuous(breaks=seq(0,7,by=0.25))+theme(text=element_text(size=20))+xlab("Capacity (MW)") -CONST_PLOT <- ggplot(DATA,aes(x=Capacity,y=Peak_Const))+geom_point()+geom_smooth(method='lm')+theme_bw()+ylab("Peak Construction Employment" )+scale_x_continuous(breaks=seq(0,5000,by=250),labels = scales::comma)+scale_y_continuous(breaks=seq(0,20000,by=200),labels = scales::comma)+theme(text=element_text(size=20))+xlab("Capacity (MW)" +CONST_PLOT <- ggplot(DATA,aes(x=Capacity,y=Peak_Const))+geom_point()+geom_smooth(method='lm')+theme_bw()+ylab("Peak Construction Employment" )+scale_x_continuous(breaks=seq(0,5000,by=500),labels = scales::comma)+scale_y_continuous(breaks=seq(0,20000,by=500),labels = scales::comma)+theme(text=element_text(size=20))+xlab("Capacity (MW)" ) -png(paste0(OUTPUT_DIR,"Operating_Employment_Fit.png" ) , units = "in", width = 1.25*12, height = 1.25*8, res = 600) +png(paste0(OUTPUT_DIR,"Operating_Employment_Fit.png" ) , units = "in", width = 11, height = 8, res = 600) OP_PLOT dev.off() -png(paste0(OUTPUT_DIR,"Peak_Construction_Employment_Fit.png" ) , units = "in", width = 1.25*12, height = 1.25*8, res = 600) +png(paste0(OUTPUT_DIR,"Peak_Construction_Employment_Fit.png" ) , units = "in", width = 11, height = 8, res = 600) CONST_PLOT dev.off() @@ -131,7 +131,7 @@ MOD2 <- feols(Peak_Const~Capacity+Report_Year+Report_Quality,DATA,vcov='hetero') #ggplot(DATA,aes(x=Capacity,y=Peak_Const))+geom_point()+geom_smooth(method='lm') DICT <- c("log(Emp)"="Operating Employment (ln)",Peak_Const="Peak Construction Employment",Report_Quality='Government Source',Report_Year='Data Year',Capacity='Capacity (MW)' ) -NOTES <- c("Data found for natural gas power plants listed in EIA860 fillings as planned.","Data Year: is the date a report was released","Government Source: is a dummy variable that is one if the source of data came from a government filing and not a company report.") +NOTES <- c("Data found for natural gas power plants listed in EIA860 fillings as a planned project.","Data Year is the year a report was released","Government Source is a dummy variable equal to one if the source of data was a government filing and not a company report.") etable(MOD1,MOD2,style.tex=style.tex(yesNo="$\\checkmark$"),dict=DICT,notes=NOTES,file=paste0(OUTPUT_DIR,"Reg.tex") ,export=paste0(OUTPUT_DIR,"Reg.png"),replace=TRUE,tpt=TRUE,adjustbox=TRUE,order="!Constant") ###Construction Data diff --git a/Visuals.r b/Visuals.r index ad42cf0..be7230d 100644 --- a/Visuals.r +++ b/Visuals.r @@ -27,8 +27,8 @@ MAX_VAL COOL_DOWN <- as.numeric(EMPLOY_NUM[5,3]) #EMPLOY_NUM #EMPLOY_NUM %>% filter(Category=='Total') %>% arrange(Year)%>% print(n=100) -df <- data.frame(Year=c(2032.5,2034.25,2040.25,2059.75),Employment=c(MAX_VAL+50,COOL_DOWN,687+20,596+20),text=c("Peak of 2,521","Stabalized at 878" ,"687 in 2040","Ends at 596")) -JOB_PLOT <- ggplot(EMPLOY_NUM %>% filter(Category!="Total"),aes(x=Year,y=Employment))+geom_area(position = "stack",aes(fill=Category,group=Category))+theme_bw()+scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_fill_manual(values=COLORS)+geom_line(data=EMPLOY_NUM %>% filter(Category=="Total"),linewidth=1)+geom_text(data=df,aes(label = text), vjust = "inward", hjust = "inward")+theme(legend.position = "top")+scale_y_continuous(labels = scales::comma,breaks=seq(0,3000,by=250)) +df <- data.frame(Year=c(2032.5,2034.25,2040.25,2059.75),Employment=c(MAX_VAL+125,COOL_DOWN,687+20,596+20),text=c("Peak of 2,521","Stabalized at 878" ,"687 in 2040","Ends at 596")) +JOB_PLOT <- ggplot(EMPLOY_NUM %>% filter(Category!="Total"),aes(x=Year,y=Employment))+geom_area(position = "stack",aes(fill=Category,group=Category))+theme_bw()+scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_fill_manual(values=COLORS)+geom_line(data=EMPLOY_NUM %>% filter(Category=="Total"),linewidth=1)+geom_text(data=df,aes(label = text),size=6, vjust = "inward", hjust = "inward")+theme(text = element_text(size = 20),legend.position = "top")+scale_y_continuous(labels = scales::comma,breaks=seq(0,3000,by=250)) png(paste0(OUTPUT_DIR,"Job_plot.png" ) , units = "in", width = 11, height = 8, res = 600) JOB_PLOT @@ -42,7 +42,7 @@ OUTPUT_NUM <- rbind(OUTPUT_NUM %>% filter(!(Year %in% c(2028,2029))) ,OUTPUT_NU OUTPUT_NUM$Category <- gsub(" Output","",OUTPUT_NUM$Category) OUTPUT_NUM$Category <- factor(OUTPUT_NUM$Category,levels=rev(c("Direct","Indirect","Induced","Total"))) - OUTPUT_PLOT <- ggplot(OUTPUT_NUM %>% filter(Category!="Total"),aes(x=Year,y=Output))+geom_area(position = "stack",aes(fill=Category,group=Category))+theme_bw()+scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_fill_manual(values=COLORS)+geom_line(data=OUTPUT_NUM%>% filter(Category=="Total"),linewidth=1)+theme(legend.position = "top")+scale_y_continuous(labels = scales::comma,breaks=seq(0,600,by=25))+ylab("Economic Output (Million USD)") + OUTPUT_PLOT <- ggplot(OUTPUT_NUM %>% filter(Category!="Total"),aes(x=Year,y=Output))+geom_area(position = "stack",aes(fill=Category,group=Category))+theme_bw()+scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_fill_manual(values=COLORS)+geom_line(data=OUTPUT_NUM%>% filter(Category=="Total"),linewidth=1)+theme(text = element_text(size = 20),legend.position = "top")+scale_y_continuous(labels = scales::comma,breaks=seq(0,600,by=25))+ylab("Economic Output (Million USD)") OUTPUT_PLOT png(paste0(OUTPUT_DIR,"Output_plot.png"), units = "in", width = 10, height = 8, res = 600) @@ -101,13 +101,13 @@ ORDER <- c(INDUSTRY_JOBS %>% filter(Industry!='Other') %>% group_by(Industry) % INDUSTRY_JOBS$Industry <- factor(INDUSTRY_JOBS$Industry,levels=ORDER) INDUSTRY_JOBS -JOB_TYPE_PLOT <- ggplot(INDUSTRY_JOBS ,aes(x=Year,y=Jobs,fill=Industry))+geom_bar(stat='identity')+ paletteer::scale_fill_paletteer_d("colorBlindness::Blue2DarkRed18Steps")+theme_bw()+theme(text = element_text(size = 20),legend.position = "top")+guides(fill=guide_legend(nrow=2,byrow=TRUE)) +scale_x_continuous(breaks=seq(2029,2060,by=1))+scale_y_continuous(labels = scales::comma,breaks=seq(0,3000,by=250)) -png(paste0(OUTPUT_DIR,"Job_Dist_Plot.png"), units = "in", width = 22, height = 16, res = 600) +JOB_TYPE_PLOT <- ggplot(INDUSTRY_JOBS ,aes(x=Year,y=Jobs,fill=Industry))+geom_bar(stat='identity')+ paletteer::scale_fill_paletteer_d("colorBlindness::Blue2DarkRed18Steps",name="")+theme_bw()+theme(text = element_text(size = 20),legend.position = "top")+guides(fill=guide_legend(nrow=4,byrow=TRUE)) +scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_y_continuous(labels = scales::comma,breaks=seq(0,3000,by=500)) +png(paste0(OUTPUT_DIR,"Job_Dist_Plot.png"), units = "in", width = 11, height = 8, res = 600) JOB_TYPE_PLOT dev.off() JOB_FACET_DATA <- INDUSTRY_JOBS %>% mutate(Period=ifelse(Year>2033,"Operating","Construction")) %>% group_by(Period,Industry) %>% summarize(Jobs=mean(Jobs)) %>% ungroup -JOB_FACET <- ggplot(JOB_FACET_DATA,aes(x=Period,y=Jobs,fill=factor(Period)))+geom_bar(stat='identity',width=0.99)+facet_wrap(.~Industry,nrow=5)+theme_bw()+xlab("Year")+theme(text=element_text(size=20),legend.position="top",palette.colour.discrete=c("darkslategray1","darkorchid1" ))+scale_fill_discrete(name = "Year") +scale_y_continuous(labels = scales::comma,breaks=seq(0,1000,by=100)) +JOB_FACET <- ggplot(JOB_FACET_DATA,aes(x=Period,y=Jobs,fill=factor(Period)))+geom_bar(stat='identity',width=0.99)+facet_wrap(.~Industry,nrow=5)+theme_bw()+labs(x = NULL)+theme(text=element_text(size=20),legend.position="top",palette.colour.discrete=c("darkslategray1","darkorchid1" ),axis.text.x = element_blank())+scale_fill_discrete(name = "") +scale_y_continuous(labels = scales::comma,breaks=seq(0,1000,by=100)) png(paste0(OUTPUT_DIR,"Job_Facet_Plot.png"), units = "in", width = 11, height = 11, res = 600) JOB_FACET @@ -161,17 +161,20 @@ DIRECT_TAX <- cbind(2030:2060,DIRECT_TAX ) %>% as_tibble colnames(DIRECT_TAX) <- c("Year","Tax") DOLLAR_VALUES DOLLAR_VALUES[DOLLAR_VALUES$Metric=='Wyoming Taxes','Million (USD)'] <- DOLLAR_VALUES[DOLLAR_VALUES$Metric=='Wyoming Taxes','Million (USD)'] + c(0,DIRECT_TAX$Tax) -TAX_PLOT <- ggplot(DOLLAR_VALUES %>% filter(Metric %in% c('Wyoming Taxes')), aes(x=Year,y=`Million (USD)`,fill=Metric))+geom_area()+theme_bw()+scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_y_continuous(labels = scales::comma,breaks=seq(0,3000,by=5))+theme(legend.position = "top",text=element_text(size=20))+scale_fill_manual(values=paletteer::paletteer_d("calecopal::lupinus")[4] ) -png(paste0(OUTPUT_DIR,"Total_Tax_Plot.png"), units = "in", width = 1.5*11, height = 1.5*10, res = 600) + +TAX_PLOT <- ggplot(DOLLAR_VALUES %>% filter(Metric %in% c('Wyoming Taxes')), aes(x=Year,y=`Million (USD)`,fill=Metric))+geom_area()+theme_bw()+scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_y_continuous(labels = scales::comma,breaks=seq(0,3000,by=5))+scale_fill_manual(values=paletteer::paletteer_d("calecopal::lupinus")[4],name="" )+theme(legend.position = "top",text=element_text(size=20))+ guides(fill = "none") +TAX_PLOT + +png(paste0(OUTPUT_DIR,"Total_Tax_Plot.png"), units = "in", width = 11, height = 8, res = 600) TAX_PLOT dev.off() -FACET_INDICATORS_PLOT <- ggplot(DOLLAR_VALUES , aes(x=Year,y=`Million (USD)`,fill=Metric))+geom_area()+facet_wrap(.~Metric,nrow=2)+theme_bw()+scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_y_continuous(labels = scales::comma,breaks=seq(0,3000,by=50))+theme(legend.position = "top",text=element_text(size=20))+scale_fill_manual(values=paletteer::paletteer_d("calecopal::lupinus") ) +FACET_INDICATORS_PLOT <- ggplot(DOLLAR_VALUES , aes(x=Year,y=`Million (USD)`,fill=Metric))+geom_area()+facet_wrap(.~Metric,nrow=2)+theme_bw()+scale_x_continuous(breaks=c(2029,seq(2035,2060,by=5)))+scale_y_continuous(labels = scales::comma,breaks=seq(0,3000,by=50))+scale_fill_manual(values=paletteer::paletteer_d("calecopal::lupinus") )+theme(legend.position = "top",text=element_text(size=20)) FACET_INDICATORS_PLOT -png(paste0(OUTPUT_DIR,"Facet_Indicator_Plot.png"), units = "in", width = 1.5*11, height = 1.5*10, res = 600) +png(paste0(OUTPUT_DIR,"Facet_Indicator_Plot.png"), units = "in", width = 11, height = 10, res = 600) FACET_INDICATORS_PLOT dev.off()