Closed pank closed 12 months ago
I agree that this is awkward and could be improved, but I don't know when I'll have time to get around to this though.
This should now work as intended in the dev version:
library(ggh4x)
#> Loading required package: ggplot2
#> Warning: package 'ggplot2' was built under R version 4.1.3
library(patchwork)
d <- data.frame(x = 1:10,
y = 1:10,
outer = rep(LETTERS[1:3], each=3, length.out = 10),
inner = rep(letters[4:5], each=7, length.out = 10))
g1 <- ggplot(d, aes(x, y)) + geom_point() +
facet_nested(outer+inner ~ ., nest_line = element_line())
g2 <- ggplot(d, aes(x, y)) + geom_point() +
facet_nested(outer+inner ~ .) +
theme(ggh4x.facet.nestline = element_line())
g1 + g2
Created on 2023-07-14 by the reprex package (v2.0.1)
Hi,
Perhaps I am misunderstanding the docs, but wouldn't it make more sense if the
nest_line
argument offacet_nested
would inherit directly from the theme instead of beingelement_blank
(formals(facet_nested)$nest_line
=>
element_blank()
)? Then the default theme value could be set toelement_blank()
.In particular, I would have thought that
g1
andg2
would be identical in the below example:Uploading images isn't working for me atm, but I would have thought both
g1
andg2
would have nestlines, but they are only shown ing1
.