1

Hi people,

I have a question that should be simple. I am new using iGraph and I am trying to plot by tklplot. The graph has the following characteristics:

Vertices: 856 Edges: 675 Directed: TRUE

I just want to shape to different ethnic groups that are of course attributes V(g)$ethnic of the vertices, in the graph.
I had a problem with square, but it did have a bug.
In the lines downwards I just become circle shaped vertices . My idea is to differentiate the vertices with the attribute V(g)$ethnic , if I recall it, there is no problem , but the plot output is not true , and no major problem is reported by R

as follows

  V(g)$color <- "green"
  E(g)$color <- "black"
  V(g)$nodesize=degree(g)*0.5
  V(g)[V(g)$ethnic=="Mestizo"]$shape <- "rectangle"
  V(g)[V(g)$ethnic=="Saraguro"]$shape <- "circle"
  tkplot(g, layout=layout.kamada.kawai, edge.color=E(g)$color, 
         edge.arrow.size=0.3, vertex.label.dist=0.3, vertex.color=V(g)$color, 
         vertex.size=V(g)$nodesize, vertex.shape=V(g)$shape)

regards
Vladimir

4

2 回答 2

1

根据igraph.vertex.shapes 函数文档,不支持形状,tkplot但仅支持plot.igraph

请注意,当前的顶点形状实现是实验性的,将来可能会改变。目前仅对 plot.igraph 实现顶点形状。

于 2012-02-17T20:00:08.633 回答
-1

究竟是什么没有正确绘制?iGraph 的索引偏移 1。试试这个,看看它是否有所作为:

wc1 <- which(V(g)$ethnic=="Mestizo") - 1
wc2 <- which(V(g)$ethnic=="Saraguro") - 1
V(g)$shape[wc1] <- "rectangle"
V(g)$shape[wc2] <- "circle"
于 2012-02-17T19:49:57.080 回答