Skip to content

Commit 77a8140

Browse files
committed
Prevent NA linetype
1 parent b35cf63 commit 77a8140

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/utilities-grid.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ gg_par <- function(..., stroke = NULL, pointsize = NULL) {
4141
stroke[is.na(stroke)] <- 0
4242
args$fontsize <- pointsize * .pt + stroke * .stroke / 2
4343
}
44+
if (!is.null(args$lty) && anyNA(args$lty)) {
45+
args$lty[is.na(args$lty)] <- if (is.character(args$lty)) "blank" else 0
46+
}
4447

4548
inject(gpar(!!!args))
4649
}

0 commit comments

Comments
 (0)