YuLab-SMU / ggbreak

:broken_heart: An implementation of scale functions for setting axis breaks of a 'gg' plot.
https://www.frontiersin.org/articles/10.3389/fgene.2021.774846
129 stars 4 forks source link

A blank plot is producted with plot #58

Open SficPan opened 1 year ago

SficPan commented 1 year ago

When I run: graph1 <- ggplot(a4,mapping = aes(Day,x_value,colour=factor(patient)))+ geom_line()+ guides(color=guide_legend(title = "Patient"))+ scale_y_break(c(0.3,0.75), scales = 1.5)+ scale_y_break(c(1.55,2.75), scales = 1.5) The variable graph1 is included with two plots with one blank. I don't know how to separate it from graph1 so it may cause some inconvenience in Rmarkdown.

GuangchuangYu commented 1 year ago

try

print(graph1)

in Rmarkdown code trunk.

SficPan commented 1 year ago

it doesn't work...

GuangchuangYu commented 1 year ago

We can't reproduce your issue.

You can check the vignette of ggbreak, https://cran.r-project.org/web/packages/ggbreak/vignettes/ggbreak.html, which was generated by Rmarkdown file and it works fine.