Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206278

Vertex label color -igraph

$
0
0

How to change the label color of subset of nodes in a igraph object? The following code works fine with label color of all nodes given in black.

 g <- plot(graph, layout=l, 
         edge.arrow.size=0.5, 
         vertex.label.cex=0.75, 
         vertex.label.family="Helvetica",
         vertex.label.font=2,
         vertex.shape="circle", 
         vertex.size=1, 
         vertex.label.color="black"
    , 
         edge.width=0.5)

I tried giving subset of nodes different label color using the following code but it does not work

 V(g)[c("DISC1","GSK3B", "NRG1", "BDNF","GRM5", "DLG2", "DTNBP1", "YWHAE", "GRIN2A", "CNTNAP2")]$color <- "red"

Thanks Priya


Viewing all articles
Browse latest Browse all 206278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>