You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(ggplot2)
library(ggunchull)
data("pancExample")
plotData<-pancExample#### setup a proper distance to extend (and simplify) the circle (here use 3% of the range of x axis)delta_r<-0.03th_r<-0.03delta<- diff(range(plotData$UMAP_1)) *delta_rth<- diff(range(plotData$UMAP_1)) *th_rp<- ggplot(plotData, aes(x=UMAP_1, y=UMAP_2)) +
geom_point(aes(color=celltype), size=0.3, shape=16) +
stat_unchull(aes(color=celltype, fill=celltype), alpha=0.3, n=5, delta=delta, th=th) +
theme(
aspect.ratio=1,
panel.background= element_blank(),
panel.grid= element_blank(),
axis.line= element_line()
)
p
ggsave("aaa.pdf", p, w=5,h=5)
the aaa.pdf is blank
The text was updated successfully, but these errors were encountered:
Sorry for being late replying. It may be a bug caused by the incompatibility between graphics::xspline and ggplot system. Some other packages also met similar problems, such as hrbrmstr/ggalt#70.
There are two ways to avoid this:
save graph with R basic way
pdf("aaa.pdf", w=5, h=5)
p
dev.off()
run dev.off() before ggsave
p
dev.off()
ggsave("aaa.pdf", w=5, h=5)
These both work for me, hope these can solve your problem.
the aaa.pdf is blank
The text was updated successfully, but these errors were encountered: