Skip to content

Regression in linetype scales #6096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
teunbrand opened this issue Sep 11, 2024 · 0 comments · Fixed by #6097
Closed

Regression in linetype scales #6096

teunbrand opened this issue Sep 11, 2024 · 0 comments · Fixed by #6097

Comments

@teunbrand
Copy link
Collaborator

This is a report on a regression found in revdep checks, that presents as follows:

ggplot2/revdep/problems.md

Lines 374 to 375 in d31c051

Error in grid.Call.graphics(C_lines, x$x, x$y, index, x$arrow) :
invalid line type: must be length 2, 4, 6 or 8

Briefly, setting a numeric linetype palette will throw error because na.value = "blank" which will cast the linetype as characters, which grid will not accept. I propose setting na.value = NA.

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

p <- ggplot(economics_long, aes(date, value01)) +
  geom_line(aes(linetype = variable))

p + scale_linetype_manual(values = 1:5)
#> Error in grid.Call.graphics(C_lines, x$x, x$y, index, x$arrow): invalid line type: must be length 2, 4, 6 or 8

p + scale_linetype_manual(values = 1:5, na.value = NA)

Created on 2024-09-11 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant