ggbreak icon indicating copy to clipboard operation
ggbreak copied to clipboard

theme(plot.margin) doesn't work for ggbreak

Open Nitin123-4 opened this issue 1 year ago • 2 comments

theme(plot.margin = margin(t = 2, l = 3, r = 2, b = 2, "cm")) has no impact when I am using scale_y_break. ggplot(mtcars, aes(x=cyl, y=mpg)) + geom_boxplot(fill="slateblue", alpha=0.2) + xlab("cyl")+ scale_y_break(15,20)+ theme(plot.margin = margin(t = 2, l = 3, r = 2, b = 2, "cm"))

please help with it.

Nitin123-4 avatar May 21 '24 06:05 Nitin123-4

coord_cartesian(clip="off") also fails

drdna avatar Sep 09 '24 23:09 drdna

I had this happen to me also. I got around it by moving the legend to the top and then adding a top margin to that legend. Presumably, a similar trick could work in any direction if you only need to expand plot margin in one direction...

BajczA475 avatar Feb 14 '25 17:02 BajczA475