-
Hi, is there any way to show the x-axis ticks, text and labels on both top and bottom of the facet? See image, I'd like to have the Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
teunbrand
Jun 18, 2025
Replies: 1 comment 1 reply
-
You can add a secondary x-axis guide that should do the trick. Wouldn't even need library(ggplot2)
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
facet_grid(
drv ~ .,
scales = "free_y"
) +
guides(x.sec = guide_axis(title = "displ")) Created on 2025-06-18 with reprex v2.1.1 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
saslaw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can add a secondary x-axis guide that should do the trick. Wouldn't even need
ggh4x::facet_grid2()
for this.Created on 2025-06-18 with reprex v2.1.1