我使用R中的’圆形’包和rose.diag函数创建了位置数据的方面的玫瑰图,其中包括N,NE,E等的基本方面,总共8个箱.但是,垃圾箱并没有跨越这些方面.换句话说,第一个bin从0到45,第二个从45到9
rose.diag(Degrees$Degrees, bins=8,zero=pi/2, units = 'degrees', rotation='clock')我认为Ben是正确的,使用rose.diag无法轻松完成,所以这里有一个使用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
这可能并不理想,因为并非rose.diag中的所有功能都在ggplot2中具有简单的等价物.
