Hi!
When experimenting with some of the new features introduced in version 4.0 and later, I encountered an unexpected behavior. According to the ggplot2 documentation, when the layer (layout) parameter is used in conjunction with facet_wrap, both integer vectors and the ‘fixed’ argument are valid.
https://ggplot2.tidyverse.org/reference/facet_wrap.html#:~:text=Layer%20layout,across%20every%20panel.
Layer layout
The layer(layout) argument in context of facet_wrap() can take the following values:
- NULL (default) to use the faceting variables to assign panels.
- An integer vector to include selected panels. Panel numbers not included in the integer vector are excluded.
- "fixed" to repeat data across every panel.
However, based on the results, it appears that the integer values do not seem to have any effect on the panel markers.
library(ggplot2)
ggplot(mpg, aes(displ, hwy)) +
geom_point(layout = 'fixed',colour = "grey", alpha = 0.3) +
geom_point()+
facet_wrap(vars(class), axes = "all", axis.labels = "all_y" )

ggplot(mpg, aes(displ, hwy)) +
geom_point(layout = c(1,2,3),colour = "grey", alpha = 0.3) +
geom_point()+
facet_wrap(vars(class), axes = "all", axis.labels = "all_y" )

Created on 2026-07-28 with reprex v2.1.1
Not sure if it's because I'm using it wrong, or if this is a bug? If it's the former, could you please tell me the correct way to use it?
All the best,
Hu
Hi!
When experimenting with some of the new features introduced in version 4.0 and later, I encountered an unexpected behavior. According to the ggplot2 documentation, when the
layer (layout)parameter is used in conjunction withfacet_wrap, bothinteger vectorsand the‘fixed’argument are valid.https://ggplot2.tidyverse.org/reference/facet_wrap.html#:~:text=Layer%20layout,across%20every%20panel.
However, based on the results, it appears that the integer values do not seem to have any effect on the panel markers.
Created on 2026-07-28 with reprex v2.1.1
Not sure if it's because I'm using it wrong, or if this is a bug? If it's the former, could you please tell me the correct way to use it?
All the best,
Hu