I can use ggplot2 easily to draw a graph like below:
In fact, for my data, it is like below:
degree value 1 120 0.50 2 30 0.20 3 -120 0.20 4 60 0.50 5 150 0.40 6 -90 0.14 7 -60 0.50 8 0 0.60
The first column is the degree (from -180 to 180 or from 0 to 360), the second column is the corresponding values. So I want to draw a graph point from (0,0) to each my data point with arrow but with a circular coordinate as below:
(source: matrixlab-examples.com)
I try to use follow code:
base <- ggplot(polar, aes(x=degree, y=value))
p <- base + coord_polar()
p <- p + geom_segment(aes(x=0, y=0, xend=degree, yend=value ), arrow=arrow(length=unit(0.3,"cm")) )
print(p)
It produced a polar plot, but I did not get the straight arrow from (0,0) to my data points.
I also try to use plotrix package to draw this graph. It works like below:
3 http://rgm2.lab.nig.ac.jp/RGM_results/plotrix:polar.plot/polar.plot_001_med.png
I can not import arrow in this graph.
How to add arrows using the plotrix package, or how to draw it with ggplot2?