How to plot points around a circle in R

2019-08-02 07:27发布

I am trying to plot some data on directions which vary from 0 to360 deg. The most intuitive way of doing this is around a circle where I can plot each point (I only have 13 points to plot).

cont=c(319,124,182,137,55,302,221,25,8,36,132,179,152)

My data for one plot

I tried following the ggplot2 guides and have not got it to work. I'm not very good at ggplot though...

(my dataframe is called "data")

ggplot(data, aes(x=1), ) + coord_polar(theta = "y") +geom_point(y=cont)

标签: r plot geometry
2条回答
做自己的国王
2楼-- · 2019-08-02 07:42

Have you tried polar.plot from plotrix library?

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-08-02 07:54

It works adding y to the ggplot mapping

data <- data.frame(cont = cont)
ggplot(data, aes(x=1, y = cont)) + coord_polar(theta = "y") + geom_point()

You can add other ggplot parameters to improve the appearence.

查看更多
登录 后发表回答