igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] postscript and label.family and a question about layout.lgl


From: Vincent Matossian
Subject: Re: [igraph] postscript and label.family and a question about layout.lgl
Date: Sat, 7 Jul 2007 19:36:51 -0400


 Thanks Gabor! that's very helpful. Your first posted guess is how I was plotting it but the legend doesn't fit in the plot when there are many colors, and I wanted a more "continuous" palette,  the colorbar plot seems to do it :)

Sorry for jumping from subject to subject within a single thread, but I found plots of  Internet datasets at http://www.opte.org/maps/ that use LGL, in igraph, is there a way to customize layout.lgl to give the plot a similar tree-like look rather than fitting points inside a square area?

Continuously thankful for the invaluable help and for igraph!

Vincent


On 7/6/07, Gabor Csardi <address@hidden> wrote:
On Fri, Jul 06, 2007 at 06:54:55PM -0400, Vincent Matossian wrote:
>
> I had completely missed that, thanks for the quick fix Gabor!   :)
>
> I'm trying to create a legend with something similar to colorkey in
> heat/level/
> contour plots, but with the colors representing colors as
> properties of nodes
> in the graph. Does anyone have an idea how it can be done in R?

Hmm, i'm not sure what exactly you mean, but here are two guesses:

##############
# http://www.rmki.kfki.hu/~csardi/colorbar2.png

library(igraph)

g <- barabasi.game(100)
V(g)$color <- sample(heat.colors (5), vcount(g), repl=TRUE)

lay <- layout.fruchterman.reingold(g)
plot(g, layout=lay, vertex.size=5, vertex.label=NA,
     edge.arrow.size=0.6, margin=-0.2)
legend(-1.2, -1.1, col=heat.colors(5), c("foo", "bar", "foobar", "what", "is"),
       fill=heat.colors(5), yjust=0)


################
# http://www.rmki.kfki.hu/~csardi/colorbar2.png

g <- barabasi.game(100)
V(g)$color <- sample( heat.colors(20), vcount(g), repl=TRUE)

lay <- layout.fruchterman.reingold(g)
plot(g, layout=lay, vertex.size=5, vertex.label=NA,
     edge.arrow.size=0.6, margin=c(-0.1,0.1,-0.1,-0.1))
library(fields)
colorbar.plot(-1.1, 1, strip=1:20, strip.width=0.05,
              strip.length=1, col=heat.colors(20),
              horizontal=FALSE, adj.x=1, adj.y=1)
rect(-1.1,1,-1.1-(2.3*0.05),-1)
################

I don't really like colorbar.plot though, there might be a better
solution, you may ask it on the R-help list.

Gabor

> thanks
> -
> Vincent
>

--
Csardi Gabor < address@hidden>    MTA RMKI, ELTE TTK


_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

[Prev in Thread] Current Thread [Next in Thread]