teunbrand / ggh4x

ggplot extension: options for tailored facets, multiple colourscales and miscellaneous
https://teunbrand.github.io/ggh4x/
Other
542 stars 33 forks source link

Misplacement of nest line if strips are vertical #50

Closed teunbrand closed 2 years ago

teunbrand commented 2 years ago

As in title. The correct behaviour should be to place the nest line in between the "A" and "a", "b" labels instead of underneath the "A" strip. Incorrect behaviour example below:

library(ggplot2)
library(ggh4x)

df <- data.frame(
  x = 1,
  outer = c("A", "A", "B"),
  inner = c("a", "b", "c")
)

ggplot(df, aes(x, x)) +
  geom_point() +
  facet_nested(
    outer + inner ~ ., nest_line = element_line(size = 10)
  )

Created on 2021-08-31 by the reprex package (v1.0.0)