igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] vertex shapes


From: Gábor Csárdi
Subject: Re: [igraph] vertex shapes
Date: Fri, 16 Jan 2009 14:31:30 +0100

OK, this was a stupid mistake that I do all the time. Shapes only work
properly if the graph is called 'g'. It was corrected in the
development branch, so perhaps you can try to install the preliminary
R packages at

http://cneurocvs.rmki.kfki.hu/igraph/download/igraph_0.6.tar.gz
http://cneurocvs.rmki.kfki.hu/igraph/download/igraph_0.6.tar.gz

(The latter is for windows.)

Or, you can correct it yourself, in plot.R, replace 'vcount(g)' with
'vcount(graph)'.

Best,
G.

ps. please sign up to the list, otherwise I will have to acknowledge
your emails by hand, and that might take days if I am on holiday....

On Fri, Jan 16, 2009 at 2:10 PM, Robin Cowan <address@hidden> wrote:
> I am using igraph inside R.
>
> I am trying to draw a graph in which the vertices have different shapes from
> each other.
> A sample of the sort of thing I am trying to do would be the following:
> g1<-graph.ring(10)
> v1<-c("square","square","square","square","square","square","square","square","square","square")
> plot.igraph(g1,vertex.shape=v1)
>
> This works fine.
>
> But then if I do, for example,
>
> v1[10]<-"circle"
> plot.igraph(g1,vertex.shape=v1)
>
> The graph is drawn, but the labels are omitted, and I get the error
> Error in FUN(1:100[[11L]], ...) : attempt to apply non-function
>
> (Same outcome no matter which element of v1 I change to "circle".)
>
> I get the same result if I do
>
> V(g1)$shape=v1
> plot.igraph(g1)
>
> I get similar (though slightly more complex) behaviour when I do it  with
> the graph that I really want to draw, as opposed to this simple example.
>
> Has anyone had any luck with vertex shapes along these lines? Any tricks to
> get it to work?
>
> Thanks,
>
> Robin Cowan
>
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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