You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, ggplot2 reasonably clips long facet labels. While this can be turned off by manipulating the underlying grobs, it would be nice for some circumstances if you could set clip = "off" in a related ggplot2 function, as you can in the coord_*() functions.
library(ggplot2)
iris$Species<-factor(
iris$Species,
labels= c(
"Here is a pretty long label that might not make it, if we're being totally honest",
"here's a shorter one",
"shorter yet"
)
)
ggplot(iris, aes(Sepal.Length, Sepal.Width)) +
geom_point() +
facet_wrap(vars(Species))
It would be quite easy to make this a theme setting (I have just fiddled with that code in another matter). What say the @clauswilke, @hadley, do you have any objections to this?
This is fixed by #4223, though the long label is obscured on the right by the strip background of the middle panel.
library(ggplot2)
iris$Species<-factor(
iris$Species,
labels= c(
"Here is a pretty long label that might not make it, if we're being totally honest",
"here's a shorter one",
"shorter yet"
)
)
ggplot(iris, aes(Sepal.Length, Sepal.Width)) +
geom_point() +
facet_wrap(vars(Species)) +
theme(strip.clip="off")
By default, ggplot2 reasonably clips long facet labels. While this can be turned off by manipulating the underlying grobs, it would be nice for some circumstances if you could set
clip = "off"
in a related ggplot2 function, as you can in thecoord_*()
functions.Created on 2019-12-20 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: