# Mark each scatter point uniquely

**URL:** <https://discourse.julialang.org/t/mark-each-scatter-point-uniquely/58803>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [April 8, 2021, 5:11am UTC](https://discourse.julialang.org/t/mark-each-scatter-point-uniquely/58803 "2021-04-08T05:11:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![quazirfan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quazirfan/32/23381_2.png) [@quazirfan](https://discourse.julialang.org/u/quazirfan)\
**Post date:** [April 8, 2021, 5:11am UTC](https://discourse.julialang.org/t/mark-each-scatter-point-uniquely/58803/1 "2021-04-08T05:11:38Z")

</div>

I am making a scatter plot with 10 points. I need to be able to identify each point individually since they will move and I want to track their movement.

Is it possible to mark each points with numbers? Or some unique symbols individually?

I am using Plots.jl.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [April 8, 2021, 5:42am UTC](https://discourse.julialang.org/t/mark-each-scatter-point-uniquely/58803/2 "2021-04-08T05:42:10Z")

</div>

```julia
plot(x, y; st=:scatter, texts=1:length(x))

```

works if you’re fine with kind of ugly.

---

<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:** [April 8, 2021, 6:37am UTC](https://discourse.julialang.org/t/mark-each-scatter-point-uniquely/58803/3 "2021-04-08T06:37:45Z")

</div>

For the 10 [different colors](http://juliagraphics.github.io/Colors.jl/stable/colormapsandcolorscales/#Colors.distinguishable_colors) :

```julia
scatter(rand(10), rand(10), c=distinguishable_colors(10), ms=7, legend=false)

```

---

<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:** [April 8, 2021, 7:52am UTC](https://discourse.julialang.org/t/mark-each-scatter-point-uniquely/58803/4 "2021-04-08T07:52:09Z")

</div>

The following 2-in-1 may please:

```julia
using Plots; gr()

x, y = rand(10), rand(10)
dy = diff([extrema(y)...])[1]/20 # adjust offset if needed
c = distinguishable_colors(10)
scatter(x, y, c=c, ms=7, legend=false)
[annotate!(x, y+dy, Plots.text(string(i), c[i], 12)) for (i,x, y) in zip(1:10,x,y)];
plot!()

```

![Plots_annotated_with_different_colors](https://global.discourse-cdn.com/julialang/original/3X/5/4/543822a8df14ceb100c664334dcf18ac222e74bd.png)  
theme(:dark)  
 ![Plots_annotated_with_different_colors2](https://global.discourse-cdn.com/julialang/original/3X/7/7/776b5888b05f6300ad98a0042741aa653e25b9f5.png)
