# Vegalite.jl: use dots for separation sign

**URL:** <https://discourse.julialang.org/t/vegalite-jl-use-dots-for-separation-sign/35569>\
**Category:** Visualization\
**Created:** [March 5, 2020, 10:57am UTC](https://discourse.julialang.org/t/vegalite-jl-use-dots-for-separation-sign/35569 "2020-03-05T10:57:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [March 5, 2020, 10:57am UTC](https://discourse.julialang.org/t/vegalite-jl-use-dots-for-separation-sign/35569/1 "2020-03-05T10:57:35Z")

</div>

Is there a setting to use `.` instead of `,` for digit separation in the resulting plot itself?

(E.g., `1.000` instead of `1,000` for a thousand.)

Alternatively, is there a setting to use a space character?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [March 5, 2020, 1:14pm UTC](https://discourse.julialang.org/t/vegalite-jl-use-dots-for-separation-sign/35569/2 "2020-03-05T13:14:01Z")

</div>

You can use labelExpr as in the following example:

```julia
using VegaLite, DataFrames

data = DataFrame(
    x=[1,2,3,4,5,6,7],
    y=[10,30,missing,15,missing,40,20]
)

data |>
@vlplot(
    mark={
        :line,
        point=true
    },
    x={"x:q",axis={labelExpr="format(datum.label,'.1f')"}},
    y=:y
)

```

which changes the x labels from integer to floats.  
The format specifier is a d3-format specifier:

> **[GitHub - d3/d3-format: Format numbers for human consumption.](https://github.com/d3/d3-format/)**
>
> Format numbers for human consumption. Contribute to d3/d3-format development by creating an account on GitHub.

And see also

> **[Expressions](https://vega.github.io/vega/docs/expressions/#format-functions)**
>
> Vega - A Visualization Grammar. Vega is a visualization grammar, a declarative format for creating, saving, and sharing interactive visualization designs. With Vega, you can describe the visual appearance and interactive behavior of a visualization...

Changing . to , is probably a locale setting in d3-formats, but I didn’t found out how to set them from VegaLite/Vega

So, e.g. if you can’t find the proper d3-format, you can provide the labels explicit in the data, e.g. based on the above example:

```julia
data[!,:labels]=["1,0","2,0","3,0","4,0","5,0","6,0","7,0"]
data |>
       @vlplot(
           mark={
               :line,
               point=true
           },
           x={"labels:n",title="x"},
           y=:y
       )

```

The details depend on the type of plot you are going to create.

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [March 5, 2020, 1:38pm UTC](https://discourse.julialang.org/t/vegalite-jl-use-dots-for-separation-sign/35569/3 "2020-03-05T13:38:44Z")

</div>

Thanks, though it seems very cumbersome in Vegalite like that.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [March 5, 2020, 1:40pm UTC](https://discourse.julialang.org/t/vegalite-jl-use-dots-for-separation-sign/35569/4 "2020-03-05T13:40:17Z")

</div>

VegaLite is somehow cumbersome.  
VegaLite.jl is already less cumbersome 😉

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [March 5, 2020, 3:07pm UTC](https://discourse.julialang.org/t/vegalite-jl-use-dots-for-separation-sign/35569/5 "2020-03-05T15:07:36Z")

</div>

Indeed, and most useful.
