I have points on the edge of a plot which is clipped off by facets.
Here is a dummy example based on this question, since it is related.
library(ggplot2)
df1 <- data.frame(x=1:10,y=1:10,c=rep(c("a","b"),each=5))
p <- ggplot(df1,aes(x,y)) +
geom_point(size=10)+
scale_y_continuous(expand=c(0,0))+
facet_grid(c~.)
print(p)
I have tried as below. But this does not affect facet clipping.
gt <- ggplot_gtable(ggplot_build(p))
gt$layout$clip[gt$layout$name=="panel"] <- "off"
grid.draw(gt)
Also tried
gt$layout$clip[gt$layout$name=="strip-right"] <- "off"
Changing axis limits is not the solution I am looking for. This is a dummy example and probably not the best example. But, I have a more complex situation where points are clipped off by facet and the axis limits are fixed too.
Is it possible to have the point shown over the facet or the facet moved a bit to the right.