# Linewidth in data space in GLMakie

**URL:** <https://discourse.julialang.org/t/linewidth-in-data-space-in-glmakie/115502>\
**Category:** Visualization\
**Tags:** makie, glmakie\
**Created:** [June 11, 2024, 5:35pm UTC](https://discourse.julialang.org/t/linewidth-in-data-space-in-glmakie/115502 "2024-06-11T17:35:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [June 11, 2024, 5:35pm UTC](https://discourse.julialang.org/t/linewidth-in-data-space-in-glmakie/115502/1 "2024-06-11T17:35:30Z")

</div>

How can I make the linewidth of a `lines` plot be in data space, so that ot changes when scrolling?

---

<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:** [June 11, 2024, 8:50pm UTC](https://discourse.julialang.org/t/linewidth-in-data-space-in-glmakie/115502/2 "2024-06-11T20:50:14Z")

</div>

There’s no way to do that. You can plot a poly instead though, it might not be completely trivial to compute it given your data points.

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [June 12, 2024, 3:49pm UTC](https://discourse.julialang.org/t/linewidth-in-data-space-in-glmakie/115502/3 "2024-06-12T15:49:21Z")

</div>

You could compute that using `buffer` from GeometryOps or LibGEOS.

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [June 12, 2024, 6:45pm UTC](https://discourse.julialang.org/t/linewidth-in-data-space-in-glmakie/115502/4 "2024-06-12T18:45:39Z")

</div>

`text` has a `markerspace` attribute for this. Can I not use some transformation used for that?

---

<div class="post-metadata">

**Author:** ![oscarvdvelde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscarvdvelde/32/202157_2.png) [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Post date:** [June 13, 2024, 3:01am UTC](https://discourse.julialang.org/t/linewidth-in-data-space-in-glmakie/115502/5 "2024-06-13T03:01:31Z")

</div>

I guess one could use the `linewidth` attribute attached to an `Observable` which scales with your data x or y range which you can get from `ax.finallimits` when you use the built-in rectangle zoom or mouse scroll.

---

<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:** [June 13, 2024, 7:36am UTC](https://discourse.julialang.org/t/linewidth-in-data-space-in-glmakie/115502/6 "2024-06-13T07:36:03Z")

</div>

This should be a backend feature. I think it’s not too hard to add, but would need someone to work on it for a couple of days.
