0

我想为 r 中的方位角数据绘制玫瑰图。我在这篇文章中找到了代码(How to shift bins in a rose diagram using package 'circular' in R)。我设法让代码与我的数据一起工作,但是,我想改进它的外观。具体来说,我希望挖起杆有黑色边框。我不知道如何在 ggplot2 中做到这一点。任何人都有几分钟的时间告诉我我将如何做到这一点?提前致谢。

library(ggplot2)
Degrees <- runif(100, 0, 360)
rose <- ggplot(mapping = aes(x = Degrees)) +
  stat_bin(breaks = (0:8 - 0.5)/8 * 360) +
  scale_x_continuous(
    breaks = 0:7/8*360, 
    labels = c("N", "NE", "E", "SE", "S", "SW", "W", "NW")
    ) +
  coord_polar(start=-pi/8)
rose
4

0 回答 0