Skip to content

Commit

Permalink
Updating legend options
Browse files Browse the repository at this point in the history
Updating legend options
  • Loading branch information
knoiva-indecon committed Feb 21, 2024
1 parent 16e9ba1 commit 821cb7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions FrEDI/testing/utils_plot_DOW_byImpactTypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,10 @@ plot_DOW_byImpactTypes <- function(

### Add Plot Title & Y Title
# plotList_i <- list(spacer1=spacer0, plot=plotGrid_i, legend=legend0)
plotList_i <- list(spacer1=spacer0, plot=plotGrid_i, legend=grobLgd0)
# plotList_i <- list(spacer1=spacer0, plot=plotGrid_i, legend=grobLgd0)
plotList_i <- list(spacer1=spacer0, plot=plotGrid_i, spacer2=spacer0, legend=grobLgd0)
# plotGrid_i <- ggarrange(plotlist=plotList_i, nrow=2, ncol=1, common.legend=T, legend="none", heights=c(0.1, n_impTypes, 0.25))
plotGrid_i <- ggarrange(plotlist=plotList_i, nrow=3, ncol=1, legend="none", heights=c(0.01, n_impTypes, 0.2))
plotGrid_i <- ggarrange(plotlist=plotList_i, nrow=3, ncol=1, legend="none", heights=c(0.01, n_impTypes, 0.01, 0.2, 0.01))
title0_i <- sector0
grobTit_i <- text_grob(title0_i, color="black", size=14, face="bold", hjust=0.5)
plotYTit_i <- text_grob(yTitle, color = "black", rot = 90)
Expand All @@ -277,13 +278,13 @@ plot_DOW_byImpactTypes <- function(
# return(plotGrid_i)

### Add Note
# note_i <- "Note: Figure scale varies by impact type"
note_i <- create_fig_scale_note(ntypes=n_impTypes, nvars=n_variants)
doNote_i <- !(note_i == "")
if(doNote_i){
plotNote_i <- text_grob(note_i, face = "italic", size=10, hjust=.93)
plotGrid_i <- plotGrid_i |> annotate_figure(bottom = plotNote_i)
} ### End if(doNote_i)
# # note_i <- "Note: Figure scale varies by impact type"
# note_i <- create_fig_scale_note(ntypes=n_impTypes, nvars=n_variants)
# doNote_i <- !(note_i == "")
# if(doNote_i){
# plotNote_i <- text_grob(note_i, face = "italic", size=10, hjust=.93)
# plotGrid_i <- plotGrid_i |> annotate_figure(bottom = plotNote_i)
# } ### End if(doNote_i)

###### ** Return Impact Year Plots ######
return(plotGrid_i)
Expand Down
4 changes: 2 additions & 2 deletions FrEDI/testing/utils_save_report_objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ save_appendix_figures <- function(
ntypes == 5 ~ 3,
nrows == 3 ~ 1.5,
nrows == 4 ~ 2,
nrows > 4 ~ lgdRows * 0.3,
nrows > 4 ~ lgdRows * 0.2,
.default = 1
)
1.5 + spacer0 + factor0 * ntypes
Expand Down Expand Up @@ -222,7 +222,7 @@ save_fig7_images <- function(
type0 <- modelType |> tolower()
### Figure options
# h0 <- ("gcm" %in% type0) |> ifelse(9, 4.5)
h0 <- ("gcm" %in% type0) |> ifelse(12, 4.5)
h0 <- ("gcm" %in% type0) |> ifelse(13, 5)
w0 <- 6.9
dev0 <- device |> tolower()
# type0 |> print(); ("gcm" %in% type0) |> print(); h0 |> print()
Expand Down

0 comments on commit 821cb7f

Please sign in to comment.