Re: [R] plot - kamada.kawai layout without arrows

From: Gary Weissman <gary_at_babelgraph.org>
Date: Tue, 12 Apr 2011 11:04:41 -0400

Hello,

It appears you are using the igraph package. You can get rid of the arrows using a few different methods.

You can make the graph undirected:

new.graph <- as.undirected(old.graph)

plot(new.graph)

Or you can simply specify the size of the arrows as zero using either

E(some.graph)$arrow.size <- 0

plot(some.graph)

OR

plot(some.graph, edge.arrow.size=0)

There are many great plotting features with the igraph package available here:

http://igraph.sourceforge.net/doc/R/plot.common.html

Best,
Gary

On Apr 12, 2011, at 6:00 AM, r-help-request_at_r-project.org wrote:

> Message: 77
> Date: Mon, 11 Apr 2011 15:09:26 -0700 (PDT)
> From: kparamas <kparamas_at_asu.edu>
> To: r-help@r-project.org
> Subject: [R] plot - kamada.kawai layout without arrows
> Message-ID: <1302559766984-3443258.post@n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hi,
>
> I am plotting a graph with kamada.kawai layout.
>
> But I am getting direction arrows in the graphs.
> Please let me know how to avoid this.
>
> g <- watts.strogatz.game(1, 2000, 5, 0.4)
>
> comps <- clusters(g)$membership
> colbar <- rainbow(max(comps)+1)
> V(g)$color <- colbar[comps+1]
>
> png(filename)
> plot(g, layout=layout.kamada.kawai, vertex.size=2, vertex.label=NA)
> dev.off()
>
> Please find attached the figure with arrows..
> http://r.789695.n4.nabble.com/file/n3443258/cdata1_plot.png

--
Gary Weissman
http://www.babelgraph.org/
gary_at_babelgraph.org




	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 12 Apr 2011 - 15:15:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 12 Apr 2011 - 15:40:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive