【发布时间】:2014-07-05 20:05:59
【问题描述】:
我有一个极坐标图。我使用 geom_path 连接点,但我希望路径是直线。这是我到目前为止所拥有的:
example <- data.frame(c(5,4,3),c(0.9,1.1,0.6))
colnames(example) <- c("r", "theta")
myplot <- ggplot(example, aes(r, theta)) + geom_point(size=3.5) +
coord_polar(theta="y", start = 3/2*pi, direction=-1) +
scale_x_continuous(breaks=seq(0,max(example$r)), lim=c(0, max(example$r))) +
scale_y_continuous(breaks=round(seq(0, 2*pi, by=pi/4),2), expand=c(0,0), lim=c(0,2*pi)) +
geom_text(aes(label=rownames(example)), size=4.4, hjust=0.5, vjust=-1) +
geom_path()
感谢任何建议。
【问题讨论】:
标签: r ggplot2 lines polar-coordinates