Skip to content

Commit dff8b54

Browse files
committed
interpret logical linewidth as integer
1 parent 6de07af commit dff8b54

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

R/utilities-grid.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ 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
44+
if (!is.null(args$lty)) {
45+
if (is.logical(args$lty)) {
46+
args$lty <- as.integer(args$lty)
47+
}
48+
if (anyNA(args$lty)) {
49+
args$lty[is.na(args$lty)] <- if (is.character(args$lty)) "blank" else 0
50+
}
4651
}
4752

4853
inject(gpar(!!!args))

0 commit comments

Comments
 (0)