Skip to content

Commit

Permalink
Updated legend parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
knoiva-indecon committed Feb 21, 2024
1 parent c270fd4 commit 5868150
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion FrEDI/testing/utils_plot_DOW_byImpactType.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ plot_DOW_byImpactType <- function(
# plot0 <- plot0 + scale_shape_discrete(lgdLbl)

###### Adjust legend title ######
if(hasLgdPos){plot0 <- plot0 + guides(color = guide_legend(title.position = lgdPos))}
# if(hasLgdPos){plot0 <- plot0 + guides(color = guide_legend(title.position = lgdPos))}

###### Add themes and title ######
plot0 <- plot0 + ggtitle(title0, subtitle0)
Expand Down
4 changes: 2 additions & 2 deletions FrEDI/testing/utils_plot_DOW_bySector.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ plot_DOW_bySector <- function(
### Legend position = bottom if refPlot; otherwise, don't show
lgdPos0 <- refPlot |> ifelse("bottom", "none")
plot0 <- plot0 + theme(legend.box = "vertical")
plot0 <- plot0 + guides(shape = guide_legend(title.position="top", ncol=3, byrow=TRUE))
plot0 <- plot0 + guides(color = guide_legend(title.position="top", ncol=3, byrow=TRUE))
plot0 <- plot0 + guides(shape = guide_legend(title.position="top", ncol=4, byrow=TRUE))
plot0 <- plot0 + guides(color = guide_legend(title.position="top", ncol=5, byrow=TRUE))
# plot0 <- plot0 + theme(legend.direction = "vertical")
plot0 <- plot0 + theme(legend.position = lgdPos0)
plot0 <- plot0 + theme(plot.title = element_blank())
Expand Down
2 changes: 1 addition & 1 deletion 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.2,
nrows > 4 ~ lgdRows * 0.3,
.default = 1
)
1.5 + spacer0 + factor0 * ntypes
Expand Down

0 comments on commit 5868150

Please sign in to comment.