将每个点连接到散点图上的每个点

我有一个数据散点图,我想将每个点连接到每个点。我在网上找到的所有内容仅将一个点连接到下一个点(例如,使用type =“ l”)。有办法吗?

谢谢!

sbsm_001 回答:将每个点连接到散点图上的每个点

基于表明使用plot(x)绘制点的注释:

# define test data and plot it
set.seed(123)
x <- rnorm(10) # test data
plot(x)

# add segments   
ix <- combn(length(x),2)
segments(ix[1,],x[ix[1,]],ix[2,x[ix[2,]])

screnshot

本文链接:https://www.f2er.com/3049467.html

大家都在问