我有一个手动指定节点顺序的 arcplot。我曾希望通过手动指定列表来设置弧色。但是,颜色不符合节点:
其中红色、蓝色和绿色之前定义为:
red <- "firebrick1"
green <- "green3"
blue <- "DodgerBlue"
color.names <- setNames(c(red, red, red, red, red,red,red,red,red,red,red,red, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue, blue,green, green , green, green ), c("OVB", "OVB-ENV", "OVB-ENV-MO", "OVB-MO", "OVB-MO-ENV", "ENV-MO", "ENV", "ENV-OVB", "ENV-MO-OVB", "MO","MO-ENV","MO-OVB", "intraverbal-tact", "intraverbal", "intraverbal-mand", "intraverbal-tact-mand","intraverbal-mand-tact", "intraverbal-echoic-mand", "intraverbal-echoic", "tact", "tact-mand", "tact-intraverbal", "tact-intraverbal-mand", "mand", "mand-tact", "mand-intraverbal", "mand-tact-intraverbal","echoic-tact", "echoic-intraverbal-mand", "echoic-intraverbal", "echoic-tact-mand","echoic-intraverbal-tact", "echoic-mand","echoic-mand-intraverbal", "echoic-tact-intraverbal","social", "social-physical", "physical-social", "physical"))
longer_order = c("OVB", "OVB-ENV", "OVB-ENV-MO", "OVB-MO", "OVB-MO-ENV", "ENV-MO", "ENV", "ENV-OVB", "ENV-MO-OVB", "MO","MO-ENV","MO-OVB", "intraverbal-tact", "intraverbal", "intraverbal-mand", "intraverbal-tact-mand","intraverbal-mand-tact", "intraverbal-echoic-mand", "intraverbal-echoic", "tact", "tact-mand", "tact-intraverbal", "tact-intraverbal-mand", "mand", "mand-tact", "mand-intraverbal", "mand-tact-intraverbal","echoic-tact", "echoic-intraverbal-mand", "echoic-intraverbal", "echoic-tact-mand","echoic-intraverbal-tact", "echoic-mand","echoic-mand-intraverbal", "echoic-tact-intraverbal","social", "social-physical", "physical-social", "physical"))
有 738 条边。
要绘制图表:
library(arcdiagram)
arcplot(F1, ordering=longer_order, col.arcs = color.names)
是否有类似于 igraph 的 get.edglist() 用于 arcplot 的(唯一)要绘制的节点列表(来自边缘列表)?以编程方式按原点添加边缘颜色的其他方法?
要重现数据:
F1 <- structure(c("OVB", "OVB", "OVB", "OVB", "OVB-ENV", "OVB", "OVB","intraverbal-mand", "intraverbal-mand", "mand", "intraverbal","mand", "intraverbal-tact", "intraverbal", "mand-intraverbal","intraverbal-mand", "mand", "physical-social", "physical-social","social-physical"), .Dim = c(10L, 2L), .Dimnames = list(NULL,c("V1", "V2")))