我做了13个平行坐标图线,每个图有x行,每行5个点。我想改变三件事:
这是我目前的代码:
par(mfrow = c(3,5))
par(mar=c(0.1,0.1,0.1,0.1))
# For each color (cluster) in the random network
for (i in 1:max(net$colors)){
color = mergedColors[which(net$colors == i)[1]]
input = countTable[which(net$colors==i),]
parcoord(input, lty = 1, var.label = FALSE, col = color)
}
其中str(输入)是5个变量的x个观测值的数据帧。
我尝试添加x.label = c(“N”,“1”,“2”,“3”,“4”)之类的东西,但这不起作用。
编辑:
根据建议,这是一些示例数据。如果我还要包含其他内容,请告诉我:
net <- data.frame(colors=as.numeric(sample(1:15, 100, replace = T)))
mycols <- c("brown", "blue", "turquoise", "greenyellow", "red",
"pink", "green", "yellow", "magenta", "black","purple",
"tomato1","peachpuff","orchid","slategrey")
mergedColors = mycols[net$colors]
countTable <- data.frame(matrix(sample(1:100,100*5, replace=T),
ncol=5, dimnames=list(NULL, c("Norm","One","Two","Three","Four"))))
答案 0 :(得分:2)
行。我不确定我理解请求1,但这是我到目前为止所提出的
library(MASS)
opar<-par(no.readonly=T)
par(mfrow = c(3,5))
par(oma=c(1.2,2,2,0))
par(mar=c(2,2,0.1,0.1))
# For each color (cluster) in the random network
for (i in 1:max(net$colors)){
color = mergedColors[which(net$colors == i)]
input = countTable[which(net$colors==i),]
colnames(input)<-c("N",1:4)
parcoord(input, lty = 1, var.label = FALSE, col = color)
axis(2,at=seq(0,1,length.out=5),labels=seq(min(input),max(input), length.out=5))
}
mtext("Main Title",3, outer=T)
par(opar)