围绕ggplot2中的一系列点放置边界 [英] Placing a boundary around a series of points in ggplot2
本文介绍了围绕ggplot2中的一系列点放置边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一系列要放置边界的点。我怎么去解决这个问题?
这些是我的观点:$ b $ b
我尝试过geom_line,但是这显然是错误的,因为它产生了这个!
谢谢
解决方案使用
geom_path
而不是 geom_line
。这里是一个例子: i < - seq(0,2 * pi,length.out = 50)$ b $ (dat,aes(x,y))b b
library(ggplot2)
ggplot + geom_line()
ggplot(dat,aes(x,y))+ geom_path ()
I have a series of points that I want to place a boundary around. How can I go about this?
These are my points:
I tried geom_line but that was obviously wrong since it produced this!
Thanks
解决方案
Use geom_path
instead of geom_line
. Here is an example:
i <- seq(0, 2*pi, length.out=50)
dat <- data.frame(x=cos(i), y=sin(i))
library(ggplot2)
ggplot(dat, aes(x, y)) + geom_line()
ggplot(dat, aes(x, y)) + geom_path()
这篇关于围绕ggplot2中的一系列点放置边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文