# Change line attributes in GraphMakie

**URL:** <https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923>\
**Category:** General Usage\
**Tags:** makie\
**Created:** [August 18, 2022, 1:11pm UTC](https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923 "2022-08-18T13:11:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PavanChaggar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pavanchaggar/32/21597_2.png) [@PavanChaggar](https://discourse.julialang.org/u/PavanChaggar)\
**Post date:** [August 18, 2022, 1:11pm UTC](https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923/1 "2022-08-18T13:11:33Z")

</div>

Hi,

Is there a way to change the transparency of the linesegments in a graphplot?

At the moment I have a `graphplot` that looks like this:

 ![test](https://global.discourse-cdn.com/julialang/original/3X/5/b/5bbaae0f7f32f2d19284d023d432e3868c822c36.jpeg)

where the seems to be a white border around edges with a small width. I think I have previously removed this by setting `transparent=true` within `lines!`, but I’m not sure how to do this with GraphMakie.

Thanks,  
Pavan

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [August 18, 2022, 1:51pm UTC](https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923/2 "2022-08-18T13:51:10Z")

</div>

If graphplot returns a plot type, you can look in its `.plots` field for the LineSegments and set `transparency = true` on that

---

<div class="post-metadata">

**Author:** ![PavanChaggar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pavanchaggar/32/21597_2.png) [@PavanChaggar](https://discourse.julialang.org/u/PavanChaggar)\
**Post date:** [August 18, 2022, 5:59pm UTC](https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923/3 "2022-08-18T17:59:42Z")

</div>

Hmm, after some digging I found the `LineSegments` and changed the `transparency` to `true`, but this did not fix the issue as I thought it might ☹  
If I use `lines!` to draw the edges and set `transparency = false` then I get an image similar to above, with the white borders around the edges. Changing to `transparency=true` fixes this and gets rid of the white borders.

---

<div class="post-metadata">

**Author:** ![PavanChaggar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pavanchaggar/32/21597_2.png) [@PavanChaggar](https://discourse.julialang.org/u/PavanChaggar)\
**Post date:** [August 18, 2022, 6:12pm UTC](https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923/4 "2022-08-18T18:12:01Z")

</div>

oh wait! it seems to just display incorrectly in the GLMakie window:

 ![Screenshot 2022-08-18 at 19.08.52](https://global.discourse-cdn.com/julialang/original/3X/9/f/9f4a7baf0323da40cf5ef7cef3d95c26ac329e86.jpeg)  
but the saved output looks correct:  
 ![test](https://global.discourse-cdn.com/julialang/original/3X/b/4/b4ae8b5411fb443c9e3042b24dcd6934d1121a6a.jpeg)

---

<div class="post-metadata">

**Author:** ![PavanChaggar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pavanchaggar/32/21597_2.png) [@PavanChaggar](https://discourse.julialang.org/u/PavanChaggar)\
**Post date:** [August 18, 2022, 6:30pm UTC](https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923/5 "2022-08-18T18:30:41Z")

</div>

oh, this only seems to happen if it’s changed after the GLMakie window is open

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [August 18, 2022, 6:34pm UTC](https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923/6 "2022-08-18T18:34:57Z")

</div>

Ah yeah, transparency might not be “interactive” ☹ Would be nice to change that, but that means you can’t change it after displaying right now…

---

<div class="post-metadata">

**Author:** ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Post date:** [August 19, 2022, 4:38pm UTC](https://discourse.julialang.org/t/change-line-attributes-in-graphmakie/85923/7 "2022-08-19T16:38:20Z")

</div>

You may also use the `edge_attr` argument and pass a named tuple to that, i.e. `edge_attr=(transparacy=true;)`. With this you can pass arbitrary arguments to the underlying linesegments plot.
