stackoverflow 上有人给了一个解决方案,能基本解决问题但还是histogram。。。。
d <- structure(list(Angle = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90,
100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220,
230, 240, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 250
), Frequency = c(0, 0, 0.001, 2, 4, 18.03, 11, 12, 5, 7, 10,
13, 2, 0.003, 0.01, 0, 1, 0.05, 2, 3, 3.7, 6, 0, 0, 0, 0, 0.2,
0.006, 0, 0, 0, 0, 0, 0, 0, 0)), .Names = c("Angle", "Frequency"
), row.names = c(NA, 36L), class = "data.frame")
d$radian = d$Angle*pi/180
d$x = d$Frequency*cos(d$radian)
d$y = d$Frequency*sin(d$radian)
m = max(d$x, d$y)
graphics.off()
windows(width = 6, height = 6)
plot(x = m,
y = m,
xlim = c(-m,m),
ylim = c(-m,m),
type = "n",
asp = 1,
axes = FALSE,
xlab = "",
ylab = "")
par(xpd = TRUE)
symbols (x =c(0,0,0,0,0), y = c(0,0,0,0,0), circles=c(3,6,9,12,15), fg = "grey",
add = TRUE, inches = FALSE, lty = 2)
lines(x = c(-15,15), y = c(0,0), lty = 2)
lines(x = c(0,0), y = c(-15,15), lty = 2)
text(x = c(0,0,-15,15), y = c(-15,15,0,0),
labels = c("180","0","270","90"), pos = c(1,3,2,4))
for (i in 1:nrow(d)){
lines(x = c(0,d$x[i]), y = c(0,d$y[i]), lwd = 3)
}
|