How to get a smooth rim line in my ggjoy plot in R?

533 Views Asked by At

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?

0

There are 0 best solutions below