Skip to content

Commit 5ad6656

Browse files
committed
Bug fix for legend lables
1 parent bc3bf9e commit 5ad6656

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

R/add_river_legend.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ add_river_legend <- function(
4848
if(grepl(pattern = "\\)$", x = cs[nc])){
4949
cs[nc] <- paste0(strsplit(x = cs[nc], split = ",")[[1]][1])
5050
}
51+
cs <- gsub(pattern = " ", replacement = "", x = cs)
5152
cs <- gsub(pattern = "\\[", replacement = "", x = cs)
5253
cs <- gsub(pattern = "\\(", replacement = "> ", x = cs)
5354
cs <- gsub(pattern = "\\,", replacement = " - ", x = cs)
5455
cs <- gsub(pattern = "\\]", replacement = "", x = cs)
55-
cs <- gsub(pattern = "^< -Inf - ", replacement = "", x = cs)
56+
cs <- gsub(pattern = "^-Inf - ", replacement = "<= ", x = cs)
5657
cs <- gsub(pattern = " - Inf$", replacement = "", x = cs)
5758
l_content <- cs
5859
legend(x = lx, y = ly, legend = cs, col = cc, lwd = 6,

0 commit comments

Comments
 (0)