Skip to content

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6533.

Briefly, line geoms require special NA-handling methods because we want to exclude terminal vertices but not internal vertices from a path. We use group to determine these, but we should consider PANEL as well.

Reprex from issue:

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

d2 <- data.frame(x = 1:3, col = c("blue", "green", NA)) |> 
  tidyr::crossing(group = c("A", "B"))

ggplot(d2, aes(x, x, color = I(col), group = 1)) +
  facet_wrap(~ group) + 
  geom_line(lwd = 2)
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_line()`).

Created on 2025-07-03 with reprex v2.1.1

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

Successfully merging this pull request may close these issues.

Unexpected behaviour of colors in geom_line()
1 participant