Skip to content

Regression in linetype scales #6096

Closed

Description

@teunbrand

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions