2
votes

I'm trying to use ggforce to create a Venn - like plot overlay, but the circles are coming out looking pretty horrible. Is it possible to improve their smoothness? I have tried increasing n (number of points) but that doesnt seem to make any difference.

jdCoords %>% ggplot(aes(x,y, label=word)) +
       coord_fixed() + 
       geom_circle(aes(x0 = 0, y0 = 0.5, r = 1.25), n=180, linetype="solid", size=1, inherit.aes = FALSE) +
       geom_circle(aes(x0 = 0.75, y0 = -1, r = 1.25), n=180, linetype="dotted",size=1,inherit.aes = FALSE) +
       geom_circle(aes(x0 = -0.75, y0 = -1, r = 1.25), n=180, linetype="dashed",size=1,inherit.aes = FALSE) +
       theme_bw() + 
       theme(panel.border = element_blank(), 
         panel.grid.major = element_blank(),
         panel.grid.minor = element_blank(), 
         axis.line = element_line(colour = "black"))

enter image description here

1

1 Answers

5
votes

This probably has more to do with the way you're rendering/exporting the graph. Can you give more information about your platform/output channel? (e.g. are you saving as PNG, PDF, ... ? Are you including the result in a Word document?) Below, I use ggsave("circles.png", dpi=600) to get a higher-than-usual-resolution PNG.

Reproducible example:

library(ggforce)
library(ggplot2)
ggplot() +
coord_fixed() + 
       geom_circle(aes(x0 = 0, y0 = 0.5, r = 1.25), n=180, linetype="solid", size=1, inherit.aes = FALSE) +
       geom_circle(aes(x0 = 0.75, y0 = -1, r = 1.25), n=180, linetype="dotted",size=1,inherit.aes = FALSE) +
       geom_circle(aes(x0 = -0.75, y0 = -1, r = 1.25), n=180, linetype="dashed",size=1,inherit.aes = FALSE) +
       theme_bw() + 
       theme(panel.border = element_blank(), 
         panel.grid.major = element_blank(),
         panel.grid.minor = element_blank(), 
         axis.line = element_line(colour = "black"))
ggsave("circles.png",dpi=600)

enter image description here