# vertex.frame.color

**URL:** <https://igraph.discourse.group/t/vertex-frame-color/1305>\
**Category:** Usage\
**Tags:** R\
**Created:** [23 July 2022 15:11 UTC](https://igraph.discourse.group/t/vertex-frame-color/1305 "2022-07-23T15:11:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TKss](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@TKss](https://igraph.discourse.group/u/TKss)\
**Post date:** [23 July 2022 15:11 UTC](https://igraph.discourse.group/t/vertex-frame-color/1305/1 "2022-07-23T15:11:00Z")

</div>

Cause I want to delete the frame of the vertexes, so I used this command : vertex.frame.color=NA. But it didn’t work for triangle, star and so on, only worked for circle, square, tangle. So how can I do to delete the frame of the vertex with the shape of star and triangle?

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [23 July 2022 15:31 UTC](https://igraph.discourse.group/t/vertex-frame-color/1305/2 "2022-07-23T15:31:19Z")

</div>

Can you show a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)?

---

<div class="post-metadata">

**Author:** ![TKss](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@TKss](https://igraph.discourse.group/u/TKss)\
**Post date:** [24 July 2022 00:36 UTC](https://igraph.discourse.group/t/vertex-frame-color/1305/3 "2022-07-24T00:36:50Z")

</div>

I used the test example

```auto
shapes <- setdiff(shapes(), "")
g <- make_ring(length(shapes))
V(g)$frame.color <- NA
set.seed(42)
plot(g, vertex.shape=shapes, vertex.label=shapes, vertex.label.dist=1,
     vertex.size=15, vertex.size2=15,
     vertex.pie=lapply(shapes, function(x) if (x=="pie") 2:6 else 0),
     vertex.pie.color=list(heat.colors(5)))

```

and I got this fig

 ![plot_zoom](https://global.discourse-cdn.com/free1/uploads/igraph/original/1X/119444788ffd5c2dc265aca8e2141723f61e17f6.png)

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [25 July 2022 11:36 UTC](https://igraph.discourse.group/t/vertex-frame-color/1305/4 "2022-07-25T11:36:27Z")

</div>

`triangle` and `star` are _custom_ vertex shapes that are not in igraph by default; their code is specified inline in the example. As you can see from the code, these vertex shapes do not make into account the `vertex.frame.color` parameter to keep the example relatively short (it’s already too long for an example in my opinion, though).

If you want these custom shapes to take into account the frame color, you’ll need to copy something like this from the code of the existing built-in shape handlers:

```auto
    vertex.frame.color <- params("vertex", "frame.color")
    if (length(vertex.frame.color) != 1 && !is.null(v)) {
        vertex.frame.color <- vertex.frame.color[v]
    }

```

and then you need to pass `vertex.frame.color` to the appropriate `symbols()` call within the custom triangle / star drawing function.

Take a look at the source code of the `.igraph.shape.circle.plot()` internal function [here](https://github.com/igraph/rigraph/blob/dev/R/plot.shapes.R#L353) for inspiration.

---

<div class="post-metadata">

**Author:** ![TKss](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@TKss](https://igraph.discourse.group/u/TKss)\
**Post date:** [26 July 2022 09:15 UTC](https://igraph.discourse.group/t/vertex-frame-color/1305/5 "2022-07-26T09:15:45Z")

</div>

Thanks a lot. I have solved it! Just as you said.
