# Plot one point with a label

**URL:** <https://discourse.julialang.org/t/plot-one-point-with-a-label/79138>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [April 7, 2022, 3:10am UTC](https://discourse.julialang.org/t/plot-one-point-with-a-label/79138 "2022-04-07T03:10:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katamari](https://avatars.discourse-cdn.com/v4/letter/k/57b2e6/32.png) [@Katamari](https://discourse.julialang.org/u/Katamari)\
**Post date:** [April 7, 2022, 3:10am UTC](https://discourse.julialang.org/t/plot-one-point-with-a-label/79138/1 "2022-04-07T03:10:57Z")

</div>

I would like to plot labeled points. The code I wrote to try it out is below.

```julia
using CairoMakie
function point(x; label=L"%$x")
    scatter!((x, 0);color=:black)
    text!(label, position=(x-0.05, 0.1))
end
fig, ax=lines(-3:3, 0:0;figure=(;resolution=(600, 200)), color=:black)
point(1)
point(ℯ)
point(sqrt(2), label=L"\sqrt{2}")
point(2//3, label=L"\frac{2}{3}")
limits!(ax, 0, 3, -1, 1)
hidedecorations!(ax)
hidespines!(ax)
fig

```

The labeling is ugly.

![output](https://global.discourse-cdn.com/julialang/original/3X/d/b/db1115a83beb5303cd4bea2c6afd7eb970562c7f.png)

What is a better way?

---

<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:** [April 7, 2022, 8:54am UTC](https://discourse.julialang.org/t/plot-one-point-with-a-label/79138/2 "2022-04-07T08:54:53Z")

</div>

“ugly” is subjective, do you mean the alignment is not centered? Use this instead:

```julia
text!(label, position=(x, 0.1), align = (:center, :bottom))

```

Also note that for Latex strings, the additional lines currently only work in plain Scenes without projection, you can see that there are none in the fraction or the square root. That’s a bug that should be fixed one of these days.

---

<div class="post-metadata">

**Author:** ![Katamari](https://avatars.discourse-cdn.com/v4/letter/k/57b2e6/32.png) [@Katamari](https://discourse.julialang.org/u/Katamari)\
**Post date:** [April 7, 2022, 9:11am UTC](https://discourse.julialang.org/t/plot-one-point-with-a-label/79138/3 "2022-04-07T09:11:10Z")

</div>

2/3 and sqrt2 are obviously ugly. e also looks weird.

---

<div class="post-metadata">

**Author:** ![kfrb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kfrb/32/29557_2.png) [@kfrb](https://discourse.julialang.org/u/kfrb)\
**Post date:** [April 7, 2022, 9:50am UTC](https://discourse.julialang.org/t/plot-one-point-with-a-label/79138/4 "2022-04-07T09:50:08Z")

</div>

Note that you use the Unicode Symbol `ℯ` for the LaTeXString. With `point(ℯ, label=L"\mathbf{e}")` I get:

 ![test](https://global.discourse-cdn.com/julialang/original/3X/f/5/f55c6197195d73757d25f3a9653f25c9b82ce7eb.png)
