【发布时间】:2016-08-03 19:28:28
【问题描述】:
我想将r = theta 从 0 绘制到 20\pi,这应该是一个有十个循环的螺旋。
这工作正常:
data.frame(x=seq(0,20*pi, length.out=1000)) %>% mutate(theta=x %% (2*pi), r=x) %>%
ggplot() + aes(x=theta, y=r) + coord_polar(start=-pi/2, direction=-1) +
ggtitle("r=theta") + geom_line() + ylim(0,20*pi) + xlim(0, 2*pi)
但是当我将geom_point更改为geom_line时,它奇怪地连接了点:
我该如何解决这个问题?
【问题讨论】:
-
添加
%>% #arrange(r) %>%和+ geom_path()可以帮助您实现目标,但geom_path不会越过0线。令人费解...
标签: r ggplot2 polar-coordinates