How to close the "gap" in the smoothing curve in polar plot (ggplot2)?

It seems to me that I am making a very big mistake here, but the search did not cause anything, so here it is:

I look at saccades and have an angle and amplitude for each day.

library(ggplot2)

df = data.frame(
  angle = runif(100,0,359),
  amplitude = runif(100,0,10)
  )

p <-
  ggplot() +
  stat_smooth(data=df, aes(y=amplitude, x=angle)) +
  coord_polar()
p

      

gives me this: (I'm trying to get a closed loop without "endpoints".)

enter image description here

+3


source to share





All Articles