在r中,当我尝试在绘图函数中使用它时,行类型仅固定为六个值(1-6)。
我在互联网上搜索了一段时间,但所有解决方案都与ggplot紧密结合。这些解决方案对我的情况没用,我想调整绘图函数中的线型。
是否有可能增加线型的数量,例如(1-10),这反过来给了我十种可能性,而不是六种可能性来绘制不同的线。
这是我的代码,
E(g)$Weight <-gsub("1.0", "1", E(g)$Weight)
E(g)$Weight <-gsub("0.9", "2", E(g)$Weight)
E(g)$Weight <-gsub("0.8", "3", E(g)$Weight)
E(g)$Weight <-gsub("0.7", "4", E(g)$Weight)
E(g)$Weight <-gsub("0.6", "5", E(g)$Weight)
E(g)$Weight <-gsub("0.5", "6", E(g)$Weight)
E(g)$Weight <-gsub("0.4", "7", E(g)$Weight)
E(g)$Weight <-gsub("0.3", "8", E(g)$Weight)
E(g)$Weight <-gsub("0.2", "9", E(g)$Weight)
E(g)$Weight <-gsub("0.1", "10", E(g)$Weight)
l_line<-E(g)$Weight
l_line
l_line<-strtoi(l_line, base = 0L)
l_line
plot(g,layout=l2,
vertex.size = 1.5,
edge.lty= l_line,
rescale=F,axes=TRUE,ylim=c(0,0.7),xlim=c(0,1), asp = 0,
vertex.label.cex= 0.5,
edge.arrow.width = 0.0,
vertex.label = LETTERS[1:10],
edge.arrow.size = 0.0,
edge.color ="black")
感谢。