# Label vectors in Plots

**URL:** <https://discourse.julialang.org/t/label-vectors-in-plots/71156>\
**Category:** Visualization\
**Tags:** plotting, plots\
**Created:** [November 8, 2021, 3:55pm UTC](https://discourse.julialang.org/t/label-vectors-in-plots/71156 "2021-11-08T15:55:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [November 8, 2021, 3:55pm UTC](https://discourse.julialang.org/t/label-vectors-in-plots/71156/1 "2021-11-08T15:55:31Z")

</div>

Hi all,

Is it possible to label vectors in a plot rather than in the legend? Here is an example where I would like to label the vectors A and B.

```julia
using Plots
plot(
    sqrt.([0,.5]),
    sqrt.([0,.5]), 
    xlims = (-1.0, 1.0), 
    ylims=(-1.0,1.0), 
    arrow = true, 
    color = :black, 
    linewidth = 2, 
    label = "",
    framestyle = :origin,
)

using Plots
plot!(
    sqrt.([.5,.5]),
    sqrt.([.5,.0]), 
    arrow = true, 
    color = :black,
    linestyle=:dash, 
    linewidth = 2, 
    label = "",
    framestyle = :origin,
)

```

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 8, 2021, 4:38pm UTC](https://discourse.julialang.org/t/label-vectors-in-plots/71156/2 "2021-11-08T16:38:14Z")

</div>

You can annotate:

```julia
annotate!(0.3, 0.5, text("A", :red, 12))
annotate!(0.8, 0.3, text("B", :blue, 12))

```

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [November 8, 2021, 5:21pm UTC](https://discourse.julialang.org/t/label-vectors-in-plots/71156/3 "2021-11-08T17:21:56Z")

</div>

> [@rafael.guerra](#):
>
> ```julia
> annotate!(0.3, 0.5, text("A", :red, 12))
> annotate!(0.8, 0.3, text("B", :blue, 12))
> 
> ```

@rafael.guerra, thank you for answering so many of my questions!
