# Can not control vertex.frame.color with custom vertex.shape

**URL:** <https://igraph.discourse.group/t/can-not-control-vertex-frame-color-with-custom-vertex-shape/223>\
**Category:** Usage\
**Tags:** R\
**Created:** [14 May 2020 09:37 UTC](https://igraph.discourse.group/t/can-not-control-vertex-frame-color-with-custom-vertex-shape/223 "2020-05-14T09:37:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sixvable](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@sixvable](https://igraph.discourse.group/u/sixvable)\
**Post date:** [14 May 2020 09:37 UTC](https://igraph.discourse.group/t/can-not-control-vertex-frame-color-with-custom-vertex-shape/223/1 "2020-05-14T09:37:24Z")

</div>

Hi guys!

platform: Windows  
R version: 3.6.3  
igraph version : 1.2.5

I am trying to use more vertex.shape to visualize my network so I follow some code to add two custom shapes **triangle** and **rhombus**.  
But I found I can not control the `vertex.frame.color` to the custom shape  
A simple example

```auto
library(igraph)
g <- make_ring(10)

myrhombus <- function(coords, v = NULL, params) {
  vertex.color <- params("vertex", "color")
  if (length(vertex.color) != 1 && !is.null(v)) {
    vertex.color <- vertex.color[v]
  }
  vertex.size <- 1/200 * params("vertex", "size")
  if (length(vertex.size) != 1 && !is.null(v)) {
    vertex.size <- vertex.size[v]
  }
  symbols(x = coords[, 1], y = coords[, 2], bg = vertex.color,
          stars = cbind(1.2*vertex.size, vertex.size, 1.2*vertex.size, vertex.size),
          add = TRUE, inches = FALSE)
}
add_shape("rhombus", clip = shapes("circle")$clip,plot = myrhombus)

mytriangle <- function(coords, v=NULL, params) {
  vertex.color <- params("vertex", "color")
  if (length(vertex.color) != 1 && !is.null(v)) {
    vertex.color <- vertex.color[v]
  }
  vertex.size <- 1/200 * params("vertex", "size")
  if (length(vertex.size) != 1 && !is.null(v)) {
    vertex.size <- vertex.size[v]
  }
  
  symbols(
    x = coords[, 1], y = coords[, 2], bg = vertex.color,
    stars = cbind(vertex.size, vertex.size, vertex.size),
    add = TRUE, inches = FALSE)
}
add.vertex.shape("triangle", clip = shapes("circle")$clip,plot = mytriangle)

V(g)$shape <- c(rep("circle",3),rep("square",3),rep("triangle",2),rep("rhombus",2))

plot(g,vertex.frame.color=NA)

```

😞  
Also can somebody show my how to add a **diamond** shape and an **up-triangle** shape? 🧐

Thanks

 ![Rplot](https://global.discourse-cdn.com/free1/uploads/igraph/original/1X/6b6388b987504201b62a54fb03511ec0554624d8.png)
