Constructing petridish plots in R

None
Share this:
Embed*
Cite this:

Kalaghatgi, Prabhav (2012): Constructing petridish plots in R. figshare.

http://dx.doi.org/10.6084/m9.figshare.95852
Retrieved 17:07, Oct 23, 2014 (GMT)

Description

A sample script for constructing petridish-like plots in R

library(igraph)

# set graph size

g <- graph.empty(directed=FALSE)

node_id <- c(1:1000)

g <- add.vertices(g,nv=1000,vert_colour=sample(c('blue','red','yellow','green','purple'),1000,replace=T)
)
# edge list

E <- sample(0:999,2000,replace=T)

g <- add.edges(g,E)

# optimize layout

lay <- layout.fruchterman.reingold(g)

# plot graph


plot(g,layout=lay,vertex.label='',vertex.size=2,vertex.color=V(g)$vert_colour)

Links

Comments (0)

You must be logged in to post comments.

Cite "Filename"

Place your mouse over the citation text to select it

Embed "Constructing petridish plots in R"

Place your mouse over the embed code to select and copy it

Claim article

You claim request was sent. I will be handled in the next 24 hours.

Close window

Feedback

We appreciate all your comments, questions, suggestions or gratitude.

Login

The username or password entered are wrong.

Reset password

Your password will be sent to your registered e-mail address.

Create account

I agree to the Terms & Conditions *