Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme(plot.margin) no longer works in ggplot2 when also use "scale_y_break" #61

Open
caitlin-jeffrey opened this issue Sep 22, 2023 · 3 comments
Assignees

Comments

@caitlin-jeffrey
Copy link

caitlin-jeffrey commented Sep 22, 2023

thanks for this package, i love being able to use it to put in an axis break! wanted to report what seems like a bug that someone else had posted without a resolution on stack overflow: https://stackoverflow.com/questions/75871080/plot-margin-fails-after-scale-y-cut

once you include a line of code for scale_y_break(), the command for margins stops working. below you can try commenting out the scale_y_break() line to reproduce this issue.

library(ggplot2)
library(ggbreak)
ggplot(mtcars, aes(x=as.factor(cyl), y=mpg)) + 
    geom_boxplot(fill="slateblue", alpha=0.2) + 
    xlab("cyl")+
    theme(plot.margin = margin(t = 2, l = 3, r = 2, b = 2, "cm"))+
    scale_y_break(c(1, 7))

thanks!

@Nitin123-4
Copy link

Nitin123-4 commented May 18, 2024

Same issue I am also facing.

@PetraTschuchnig
Copy link

I have the same problem and would be very grateful for help.

@drdna
Copy link

drdna commented Sep 9, 2024

not only does plot margin no longer work but coord_cartesian(clip = "off) also does not work with ggbreak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants