[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] vertex shapes
From: |
Robin Cowan |
Subject: |
[igraph] vertex shapes |
Date: |
Fri, 16 Jan 2009 14:10:03 +0100 |
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] vertex shapes,
Robin Cowan <=