# Annotations in Makie.jl

**URL:** <https://discourse.julialang.org/t/annotations-in-makie-jl/55773>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [February 22, 2021, 11:33am UTC](https://discourse.julialang.org/t/annotations-in-makie-jl/55773 "2021-02-22T11:33:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [February 22, 2021, 11:33am UTC](https://discourse.julialang.org/t/annotations-in-makie-jl/55773/1 "2021-02-22T11:33:01Z")

</div>

Is it currently possible to annotate Makie-plots? I am thinking about having text at the root of an arrow that point to some location in the plot. I am imagining that one could DIY it by plotting a vector, and possible plotting a point at it’s root with the marker being some text, but are there any build-in, convenient features for this? I can’t seem to find any.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 22, 2021, 12:40pm UTC](https://discourse.julialang.org/t/annotations-in-makie-jl/55773/2 "2021-02-22T12:40:51Z")

</div>

[http://makie.juliaplots.org/stable/abstractplotting\_api.html#AbstractPlotting.annotations-Tuple](http://makie.juliaplots.org/stable/abstractplotting_api.html#AbstractPlotting.annotations-Tuple)

Something like:

```julia
julia> points = [Point2f0(cos(t), sin(t)) for t in LinRange(0, 2pi, 20)];

julia> colors = 1:20;

julia> figure, axis, scatterobject = scatter(points, color = colors, markersize = 15);

julia> AbstractPlotting.annotations!(string.('a':'z')[1:20], points, textsize = 0.1, font = "JuliaMono")
Annotations{Tuple{Vector{Tuple{String, Point{2, Float32}}}}}

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/e/fe398dea8d8a0e2667288858c2353f6397a71715.png)

EDIT: Apologies, my initial draft didn’t use `JuliaMono` font!

---

<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:** [February 22, 2021, 3:12pm UTC](https://discourse.julialang.org/t/annotations-in-makie-jl/55773/3 "2021-02-22T15:12:46Z")

</div>

This example doesn’t really show that text is currently always drawn with axis scaling applied, so if your scaling is not approximately equal, the text will be really stretched. ~~I have a PR waiting to fix this but the GLMakie support is still missing~~ that PR is now merged

---

<div class="post-metadata">

**Author:** ![tbenst](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbenst/32/3029_2.png) [@tbenst](https://discourse.julialang.org/u/tbenst)\
**Post date:** [September 7, 2021, 7:35pm UTC](https://discourse.julialang.org/t/annotations-in-makie-jl/55773/4 "2021-09-07T19:35:42Z")

</div>

Can this be done for a single subplot? I naively hoped `annotations!(ax, "text", (0,0))` might work but alas not implemented.

---

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [September 7, 2021, 8:50pm UTC](https://discourse.julialang.org/t/annotations-in-makie-jl/55773/5 "2021-09-07T20:50:50Z")

</div>

There is `text!(ax, "text", position=(0,0), space = :data)`, see [text](https://makie.juliaplots.org/v0.15.2/examples/plotting_functions/text/)

(I think that is the annotations replacement in current Makie.)
