0

I'm working on a graph with small multiples, and while it's pretty rudimentary since I'm very new to R and ggplot2, it works well enough for what I need. This is the code right now:

ggplot(dataggplot2multiple, aes(x=PERÍODO, y=VARIAÇÃO, group=TERRITORIALIDADE,   color=TERRITORIALIDADE)) +
geom_line() +
theme_ipsum() +
facet_wrap(~ TERRITORIALIDADE)+
scale_x_continuous(breaks=c(1819, 1920, 2021, 2122)) +
labs(title="Variação na cobertura do PAB/PBF") +
theme(axis.ticks = element_blank(),
      axis.text.y = element_blank(),
      legend.position = "none"
)

This is what it looks like:

enter image description here

The one thing I would like to change is the bottom legend. I would like these numbers (1819, 1920, 2021, 2122) to also appear right bellow my first three graphs. Is there any way to do that? Any feedback would be greatly appreciated!

Phil
  • 7,287
  • 3
  • 36
  • 66
  • `gg4hx::facet_wrap2(vars(TERRITORIALIDADE), axes = "x")`; I don't think there's a straightforward way to get those in standard ggplot2. https://teunbrand.github.io/ggh4x/articles/Facets.html#wrap – Jon Spring Jul 14 '23 at 00:33

0 Answers0