Question: Multiple Color Values For A Single Node In Igraph
0
gravatar for raunakms
6.3 years ago by
raunakms1.1k
Vancouver, BC, Canada
raunakms1.1k wrote:

I'm using a R package "igraph" for a network visualization. In the network diagram from igraph I've only seen that a particular node represented by a single color. I want to give multiple color labels to a single node (some what like a piechart) to represent different characteristics of that node. The node could be something like the picture below. Can anyone suggest me any idea how I can achieve this using igraph or using any other packages.

enter image description here

R graph • 4.7k views
ADD COMMENTlink modified 5.3 years ago by Biostar ♦♦ 20 • written 6.3 years ago by raunakms1.1k
3
gravatar for Gabor
6.3 years ago by
Gabor70
Gabor70 wrote:

Here is how to do it in igraph, it is actually pretty simple:

g <- graph.ring(10)
values <- lapply(1:10, function(x) sample(1:10,3))
plot(g, vertex.shape="pie", vertex.pie=values,
     vertex.pie.color=list(heat.colors(5)),
     vertex.size=seq(10,30,length=10), vertex.label=NA)

The example is quite self-explanatory I think, but you can also look at the ?vertex.shape.pie manual page.

ADD COMMENTlink written 6.3 years ago by Gabor70

Great Thanks .....

ADD REPLYlink written 6.3 years ago by raunakms1.1k
1
gravatar for Sudeep
6.3 years ago by
Sudeep1.6k
.
Sudeep1.6k wrote:

If you insist on using an R package try Rgraphviz and the tutorial How To Plot A Graph Using Rgraphviz section 6 "Customized node plots"

ADD COMMENTlink written 6.3 years ago by Sudeep1.6k

Thanks Sudeep. I think that Rgraphviz should solve the problem.

ADD REPLYlink written 6.3 years ago by raunakms1.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1211 users visited in the last hour