# What are the four numbers in the \`linestyle\` vector?

**URL:** <https://discourse.julialang.org/t/what-are-the-four-numbers-in-the-linestyle-vector/115106>\
**Category:** Visualization\
**Tags:** question, makie, line-style\
**Created:** [June 3, 2024, 9:38am UTC](https://discourse.julialang.org/t/what-are-the-four-numbers-in-the-linestyle-vector/115106 "2024-06-03T09:38:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [June 3, 2024, 9:38am UTC](https://discourse.julialang.org/t/what-are-the-four-numbers-in-the-linestyle-vector/115106/1 "2024-06-03T09:38:50Z")

</div>

What are the four numbers in

```julia
line!( . . . ; linestyle = Linestyle([0.5, 1.0, 1.5, 2.5]), . . . )

```

found in [this documentation](https://docs.makie.org/v0.21/reference/plots/lines) ?

I tried this `linestyle` and got dashed lines, but I’ve got stuck there because I don’t know what each number means.

I searched this forum and Google but didn’t find an explanation.

If there is no explanation, I’ll embark on a detective work and will eventually figure out, but it would be better to find out the documentation if it exists.

(The package I know uses [line, gap, line, gap] specification for a dash, but this doesn’t seem to be the case for Makie.)

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [June 3, 2024, 10:16am UTC](https://discourse.julialang.org/t/what-are-the-four-numbers-in-the-linestyle-vector/115106/2 "2024-06-03T10:16:44Z")

</div>

I could not find it via search in the docs but

```julia
help?> Linestyle
search: Linestyle

  Linestyle(value::Vector{<:Real})

  A type that can be used as value for the linestyle keyword argument of plotting functions to arbitrarily customize the linestyle.

  The value is a vector of positions where the line flips from being drawn or not and vice versa. The values of value are in units of
  linewidth.

  For example, with value = [0.0, 4.0, 6.0, 9.5] you start drawing at 0, stop at 4 linewidths, start again at 6, stop at 9.5, then
  repeat with 0 and 9.5 being treated as the same position.

```

So it’s nearly line-gap-line-gap just in position w.r.t. line width (and more in a sum sense than in individual length).

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [June 3, 2024, 12:10pm UTC](https://discourse.julialang.org/t/what-are-the-four-numbers-in-the-linestyle-vector/115106/3 "2024-06-03T12:10:58Z")

</div>

Wonderful @kellertuer ! The “help?\>” interface never occurred to me. Next time, I’ll include it in my search range.

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [June 3, 2024, 12:15pm UTC](https://discourse.julialang.org/t/what-are-the-four-numbers-in-the-linestyle-vector/115106/4 "2024-06-03T12:15:15Z")

</div>

This is usually also my last fallback; I also first search in the documentation pages and was surprised to not find it there but in the `help?>` mode.
