Skip to content

Commit 5d1583b

Browse files
committed
Fix title and plot mismatch
1 parent d138fca commit 5d1583b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

R/cosewic_tools.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ cosewic_plot <- function(
837837
}
838838

839839
g <- list()
840+
840841
if (all(title == "") & sp[1] != "PLACEHOLDER") {
841842
title <- stats::setNames(nm = sp)
842843
}
@@ -860,6 +861,15 @@ cosewic_plot <- function(
860861
points <- list(points)
861862
}
862863

864+
# Get correct order of titles for the next section.
865+
if (!is.null(names(title))) {
866+
if ("eoo" %in% which) {
867+
title <- title[names(e)]
868+
} else {
869+
title <- title[names(i)]
870+
}
871+
}
872+
863873
g <- purrr::pmap(
864874
list(e, i, points, title),
865875
\(e, i, points, title) {

0 commit comments

Comments
 (0)