1

我正在使用该ggjoy包在 R 中制作欢乐图,我的问题是形成密度图边缘的线条看起来参差不齐。

ggjoy 情节 1

我希望我的情节具有如下所示的平滑曲线:

ggjoy 情节 2

我目前的R代码如下:

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"))

我如何实现这一目标?

4

0 回答 0