1

I am using the ggjoy package to make a joy plot in R, My problem is that the lines forming the rims of the density plots look jagged.

ggjoy plot 1

I want my plot to have smooth curves like the one below:

ggjoy plot 2

My current R code is as follows:

library (ggjoy)

 p <- ggplot(data = agedata1,
        mapping = aes(x = Age,
                      y = factor(Mth,
                                 ordered = TRUE)))

p + geom_joy(alpha = 0.6, fill = "lightblue", scale = 1.5) +
  scale_x_continuous(breaks = c(25, 35, 45, 65, 75)) +
  scale_y_discrete(expand = c(0.01, 0)) + 
  labs(x = "Age", y = NULL,
   title = "Age Distribution by Month") +
  theme_joy() +
  theme(plot.title = element_text(size = 10, face = "bold"))

How do I achieve this?

Marcus Campbell
  • 2,746
  • 4
  • 22
  • 36
user3115933
  • 4,303
  • 15
  • 54
  • 94
  • 2
    (1) could we please have a reproducible example? (2) this is probably some combination of graphics driver/rendering engine. Looks like the latter plot is using [anti-aliasing](https://en.wikipedia.org/wiki/Spatial_anti-aliasing), which some (but not all) R graphics devices employ – Ben Bolker Sep 15 '17 at 16:27

0 Answers0