# R igraph 1.5.1 won't allow vertex attribute shape beside square or circle?

**URL:** <https://igraph.discourse.group/t/r-igraph-1-5-1-wont-allow-vertex-attribute-shape-beside-square-or-circle/1703>\
**Category:** Usage\
**Tags:** R\
**Created:** [17 November 2023 14:44 UTC](https://igraph.discourse.group/t/r-igraph-1-5-1-wont-allow-vertex-attribute-shape-beside-square-or-circle/1703 "2023-11-17T14:44:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jennifer\_Hinson](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/jennifer_hinson/32/1003_2.png) [@Jennifer\_Hinson](https://igraph.discourse.group/u/Jennifer_Hinson)\
**Post date:** [17 November 2023 14:44 UTC](https://igraph.discourse.group/t/r-igraph-1-5-1-wont-allow-vertex-attribute-shape-beside-square-or-circle/1703/1 "2023-11-17T14:44:35Z")

</div>

Directed graph, no weights, just descriptive. Trying to differentiate nodes based on gender (shape) & disease stage(color) M=square & F=circle work fine, need P= diamond or star. The only other shape igraph will recognize is rectangle (I’ve tried them all.) Why is this happening, updated R on Wed, how do I fix? Thank you

```auto
### SET GRAPH ATTRIBUTES
## Set node shapes based on GenderP
V(g)$shape <- ifelse(V(g)$GenderP == 'M', 'square', 
                     ifelse(V(g)$GenderP == 'F', 'circle', 'rectangle'))

# Set node colors based on IDL_Disease
V(g)$color <- ifelse(V(g)$IDL_Disease == 700, "green",
                     ifelse(V(g)$IDL_Disease == 710, "red",
                            ifelse(V(g)$IDL_Disease %in% c(720, 730, 745), "orange", NA)))

```

---

<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:** [17 November 2023 16:24 UTC](https://igraph.discourse.group/t/r-igraph-1-5-1-wont-allow-vertex-attribute-shape-beside-square-or-circle/1703/2 "2023-11-17T16:24:40Z")

</div>



---

<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 November 2023 12:32 UTC](https://igraph.discourse.group/t/r-igraph-1-5-1-wont-allow-vertex-attribute-shape-beside-square-or-circle/1703/3 "2023-11-23T12:32:52Z")

</div>

You did not give a full example to work, and I’m not sure what’s wrong, but I tried the examples from the documentation and they seem to work fine here with igraph 1.5.1:

> **[Various vertex shapes when plotting igraph graphs — shapes](https://r.igraph.org/reference/shapes.html)**
>
> Starting from version 0.5.1 igraph supports different
> vertex shapes when plotting graphs.

Do they work for you?

I’m sorry, R is not my primary language, but if there’s an issue we’ll look into it. For that we will need a [complete minimal example](https://stackoverflow.com/help/minimal-reproducible-example) that demonstrates the problem.
