Hi Simone,

> library(igraph)
> g<-graph.empty(n=0, directed=T)
> # add nodes
> g<-add.vertices(g, length(df[,1]), attr=df)
Error in add.vertices(g, length(df[, 1]), attr = df) :
  please supply names for attributes

please send reproducible code, and information about your platform.

Vertices are indeed plotted one by one if they have different shapes.

Gabor


On Fri, Feb 28, 2014 at 6:29 AM, Simone Gabbriellini <
[email protected]> wrote:

> Dear List,
>
> I have observed a strange behavior in igraph with R. If I do:
>
> g<-graph.empty(n=0, directed=T)
> # add nodes
> g<-add.vertices(g, length(df[,1]), attr=df)
> # plot
> plot(g, vertex.size=3, vertex.label.cex=0.7, vertex.label.dist=0.3)
>
> it's fast as usual, but if I do:
>
> g<-graph.empty(n=0, directed=T)
> # add nodes
> g<-add.vertices(g, length(df[,1]), attr=df)
> # shape visualization, if type = city -> squared, else circle
> V(g)[type=="city"]$shape<-"square"
> V(g)[type=="potter"]$shape<-"circle"
> # plot
> plot(g, vertex.size=3, vertex.label.cex=0.7, vertex.label.dist=0.3)
>
> then it looks like it plots vertices one by one... and it takes considerably
> more time... any guess where I am wrong?
>
> best,
> Simone
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to