# how to fix the strange edge, like -|, rather than -\>?

**URL:** <https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025>\
**Category:** Usage\
**Tags:** R\
**Created:** [30 November 2021 22:49 UTC](https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025 "2021-11-30T22:49:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lentils70](https://avatars.discourse-cdn.com/v4/letter/l/9d8465/32.png) [@Lentils70](https://igraph.discourse.group/u/Lentils70)\
**Post date:** [30 November 2021 22:49 UTC](https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025/1 "2021-11-30T22:49:45Z")

</div>

I am struggling to fix strange edges in my plot.

```r
plot(tg,
     vertex.size=5+abs(tg0.pr$vector)*200,
     vertex.label.cex=.7,
     edge.arrow.size=0.00001,
     edge.arrow.width=0.00001,
     vertex.label=V(tg)$names,
     vertex.color=V(tg)$color,
     vertex.label.color="black",
     edge.curved=0.2,
     edge.color="gray50",
     layout=layout_nicely(tg)
     )

```

results to

 ![image](https://global.discourse-cdn.com/free1/uploads/igraph/original/1X/60e7179ebffd45ae5997082dc57abb6d44232e57.jpeg)  
??? Can anyone help to sort this out?  
Using the similar lines with different data I can produce normal arrow edges…  
Many thanks!

---

<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:** [1 December 2021 08:42 UTC](https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025/2 "2021-12-01T08:42:43Z")

</div>

Can you show a self-contained minimal example that would allow us to reproduce problem?

---

<div class="post-metadata">

**Author:** ![Lentils70](https://avatars.discourse-cdn.com/v4/letter/l/9d8465/32.png) [@Lentils70](https://igraph.discourse.group/u/Lentils70)\
**Post date:** [1 December 2021 17:19 UTC](https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025/3 "2021-12-01T17:19:20Z")

</div>

Many thanks, I append the simple code. Allow size is set very small, 0.00001, otherwise background becomes a gray plan… No idea why I am having this picture… L

```auto
rm(list = ls())
gc()

t0=matrix(c(5.217060, 0, 0, 0, 0.000000, 0.000000, 0.000000, 0, 0
,0.000000 , 0 , 0 , 0, 0.000000, 0.000000 ,0.000000 , 0 , 0
,4.458724 , 0 , 0 , 0, 0.000000, 4.434984 ,0.000000 , 0 , 0
,0.000000 , 0 , 0 , 0, 0.000000, 0.000000 ,0.000000 , 0 , 0
,0.000000 ,0 , 0 ,0, 6.684027, 0.000000 ,0.000000, 0, 0
,0.000000, 0 , 0 , 0, 0.000000, 0.000000 ,0.000000 , 0 , 0
,0.000000 , 0 , 0 , 0 ,0.000000, 4.382870 ,6.358501 , 0 , 0
,0.000000 , 0 , 0 , 0, 0.000000, 0.000000 ,0.000000 , 0 , 0
,0.000000 , 0 , 0 , 0, 0.000000, 0.000000 ,0.000000 , 0 ,0),
9,9)

t=t(t0)
library(igraph)
M=unname(as.matrix(t))
tg=graph.adjacency(M) 
tg=delete.vertices(simplify(tg,remove.multiple=T,remove.loops=T),degree(tg)==0)

lay = layout_nicely(tg)

plot(tg,
     vertex.size=10,
     vertex.label.cex=.7,
     edge.arrow.size=0.00001,
     edge.arrow.width=0.00001,
     edge.curved=0.2,
     layout=lay
     )

```

 ![image](https://global.discourse-cdn.com/free1/uploads/igraph/original/1X/9f2f00a9c13b7ba353e30f92e18ab4e51377a246.png)

---

<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:** [1 December 2021 18:02 UTC](https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025/4 "2021-12-01T18:02:36Z")

</div>

I cannot reproduce the problem on macOS with R 4.1.1, igraph 1.2.9.

That said, why are you using such extreme value for arrowhead sizes? If you don’t want arrows, you can use `edge.arrow.mode='-'`.

---

<div class="post-metadata">

**Author:** ![Lentils70](https://avatars.discourse-cdn.com/v4/letter/l/9d8465/32.png) [@Lentils70](https://igraph.discourse.group/u/Lentils70)\
**Post date:** [1 December 2021 22:31 UTC](https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025/5 "2021-12-01T22:31:06Z")

</div>

Many thanks. I updated (windows 64bit) to R 4.1.2, igraph 1.2.8, and Rtool 4 but the problem persist.  
restricting edge.arrow.mode works by putting ‘-’ works, but I would like to use arrows…  
The reason why I use extreme values for arrowhead sizes are the following. if I used  
edge.arrow.size=0.01,  
edge.arrow.width=0.01,  
then I get

 ![image](https://global.discourse-cdn.com/free1/uploads/igraph/original/1X/26010c74151d0a5c514a1894aaf7459e07e21180.png)

L

---

<div class="post-metadata">

**Author:** ![Lentils70](https://avatars.discourse-cdn.com/v4/letter/l/9d8465/32.png) [@Lentils70](https://igraph.discourse.group/u/Lentils70)\
**Post date:** [2 December 2021 17:55 UTC](https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025/6 "2021-12-02T17:55:25Z")

</div>

I have tried to use a different PC and it worked. It might be related to something the R use to produce a graphic (PDF?). Many thanks to szhorvat. L

---

<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:** [3 December 2021 10:01 UTC](https://igraph.discourse.group/t/how-to-fix-the-strange-edge-like-rather-than/1025/7 "2021-12-03T10:01:45Z")

</div>

I’m sorry, this reaches the end of my knowledge.

If you have an example that does not use very extreme (large or small) values and produces unusual output, I suggest you file a bug report. Please make the example small, but complete. Include a command to export the graphics to a file (in case the issue is related to some specific graphics backend). Also include full details about your system (version, OS, etc.), just as you did here.

> **[Issues · igraph/rigraph](https://github.com/igraph/rigraph/issues)**
>
> igraph R package. Contribute to igraph/rigraph development by creating an account on GitHub.

At the moment we are short on R experts, but the problem should at least be documented so it could be looked at later.
