1

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)
user3084100
  • 249
  • 2
  • 3
  • 14

2 Answers2

2

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.

Michele Usuelli
  • 1,970
  • 13
  • 15
1

Have you tried polar.plot from plotrix library?

Tim
  • 7,075
  • 6
  • 29
  • 58
  • 1
    specifically `plotrix::polar.plot(lengths=rep(1,length(cont)),polar.pos=cont,radial.lim=c(0,1.5))` – Ben Bolker Dec 04 '14 at 17:25
  • The function is designed for this kind of plots while ggplot2 is more general and has many other applications. – Tim Dec 05 '14 at 00:11