我有一组集群输出。我想在平行坐标图中用唯一的颜色显示每个簇。我使用rggobi作为平行坐标图。我使用了这个链接http://www.ggobi.org/docs/parallel-coordinates/
下面是我将数据加载到ggobi的代码
library(rggobi)
mydata <- read.table("E:/Thesis/Experiments/R/input.cvs",header = TRUE,sep = ",")
g <- ggobi(mydata)这是我的输出

我想用不同的颜色来表示不同的集群。
发布于 2013-03-13 22:11:31
您还可以使用MASS:parcoord():
require(MASS)
cols = c('red', 'green', 'blue')
parcoord(iris[ ,-5], col = cols[iris$Species])或者使用ggplot2:
require(ggplot2)
require(reshape2)
iris$ID <- 1:nrow(iris)
iris_m <- melt(iris, id.vars=c('Species', 'ID'))
ggplot(iris_m) +
geom_line(aes(x = variable, y = value, group = ID, color = Species))

还请注意this帖子!
https://stackoverflow.com/questions/15386960
复制相似问题