Has anyone used igraph's vertex.shape functionality? This http://cneurocvs.rmki.kfki.hu/igraph/doc/R/igraph.vertex.shapes.html was promising but I could not understand. Does anyone have an example of working code?
Asked
Active
Viewed 1.5k times
1 Answers
16
The verticies are just the nodes in your graph. When you plot them you can have them as rectangles or circles or some other shapes. Whatever you think looks prettiest.
Start by looking at the example on the ?igraph.vertex.shapes
page.
g <- graph.ring(10, dir=TRUE, mut=TRUE)
plot(g, vertex.shape="rectangle", layout=layout.circle)
The allowed values for the vertex.shape
argument are given by
names(igraph:::.igraph.shapes)
[1] "circle" "square" "csquare" "rectangle" "crectangle"
[6] "vrectangle" "none"
See ?layout
for the allowed values for the layout
argument.

Richie Cotton
- 118,240
- 47
- 247
- 360
-
11st thx for the fruitful answer. `names(igraph:::.igraph.shapes)` produces `NULL` in my console though I have `igraph` package and loaded it already. There is a redirect for `?igraph.vertex.shapes` as well, it redirects to `http://127.0.0.1:27356/library/igraph/html/shapes.html` – Erdogan CEVHER Nov 08 '16 at 09:27