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

ggbreak has multiple problems #73

Open
drdna opened this issue Sep 9, 2024 · 3 comments
Open

ggbreak has multiple problems #73

drdna opened this issue Sep 9, 2024 · 3 comments

Comments

@drdna
Copy link

drdna commented Sep 9, 2024

  1. theme(plot.margin) does not work with ggbreak
  2. coord_cartesian(clip="off") does not work with ggbreak
  3. There appears to be no way to control plot margins to prevent labels from being clipped off
  4. trying to save plots with ggbreaks as pdfs using pdf() or ggsave() produces two pages - one blank one and another with the desired plot.
@ltyrone
Copy link

ltyrone commented Nov 25, 2024

@drdna - I have encountered this issue and it still persists. It's particularly vexing as I need expand = FALSE. Only workaround is to increase the axis limits = but then my tick marks do not align with the panel extent

@Yin-Tuo
Copy link

Yin-Tuo commented Dec 1, 2024

@ltyrone - I have encountered this issue and it still persists. It's particularly vexing as I need expand = FALSE. Only workaround is to increase the axis limits = but then my tick marks do not align with the panel extent
Add expand = expansion(0,0)
‘’‘ scale_y_break(c(1.5, 7.5), expand = expansion(0,0)) ’‘’.
That'll do it.

@Yin-Tuo
Copy link

Yin-Tuo commented Dec 1, 2024

@drdna There are parts of the problem you're having that I've encountered as well, but I found the answer in the previous reply given by the author, which is as follows:
2&3: Use ‘’‘expand_limits(y= c(0, 15))’‘’ instead of ‘’‘coordinate_cartesian(ylim=c(0, 15))’‘’, that solves it22 29
4: Add onefile = F, and you're done!
‘’‘ggsave("root_length.pdf", plot = p, width = 6, height = 5, onefile=F)’‘’
or
‘’‘pdf(file = "root_length.pdf", width = 6, height = 5, onefile = F)
p
dev.off()’‘’14

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

3 participants