Make axis labels horizontal with facet function

Viewed 582

I want the names on the right hand side labels of the facet plot to be horizontally so they are not cut off. For example, so it reads North England, East Midlands, etc.

Image here:

1 Answers

You can use strip.text.y = element_text(angle = 0) to rotate the facet strips on the right. I am using iris dataset to make a reproducible example.

library(ggplot2)

    ggplot() +
      geom_line(data= iris, aes(x = Sepal.Length, y = Petal.Width, 
                                colour = Species), stat = "identity") +
      facet_wrap(Species ~ ., strip.position = "right", ncol = 1, scales = "free_y") +
      theme_bw() +
      theme(strip.text.y = element_text(angle = 0),
            legend.position = "none")

Related