Taking the graph from ggplot2 help pages:
ggplot(mtcars, aes(factor(cyl))) + geom_bar() + facet_grid(. ~ vs)
Is it possible to change the border (colour and/or thickness) of only selected panels? I'd like to, for instance, change the border of the facet of '1' of faceting variable vs
.
I tried adding
theme(panel.border = element_rect(size = 3, colour = "red", fill = NA))
but that solution changes all borders.
I was also thinking about using geom_rect
or geom_polygon
but am not sure how to limit it to one plot either.
I stumbled upon this thread on R help list, but the solutions didn't work for me
Any suggestions on how to move forward will be much appreciated.