# How to mark specific points in a contour plot using plots.jl?

**URL:** <https://discourse.julialang.org/t/how-to-mark-specific-points-in-a-contour-plot-using-plots-jl/28616>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [September 10, 2019, 4:52pm UTC](https://discourse.julialang.org/t/how-to-mark-specific-points-in-a-contour-plot-using-plots-jl/28616 "2019-09-10T16:52:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiago](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tiago/32/22567_2.png) [@tiago](https://discourse.julialang.org/u/tiago)\
**Post date:** [September 10, 2019, 4:52pm UTC](https://discourse.julialang.org/t/how-to-mark-specific-points-in-a-contour-plot-using-plots-jl/28616/1 "2019-09-10T16:52:23Z")

</div>

Hello,

As the title of the post says, I want to mark specific points in a contour plot in a similar way that we do in a normal plot, like in the picture below  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/4/54e8b8e7b60746a36e076df24acdf03647bd0f8a.png)

The code that generated the plot:

```julia
plot(x,xV,title="Solution along y=0 direction",label=["y=0 direction" "."])
scatter!(x[xMax],xV[xMax],label=["Local Maximums" "."])

```

I am trying to extrapolate the same idea to a contour plot in order to get an image like this one  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/0/f01eabb911a7b0493d009927f067f6db64704012.png)

Where the red dots are the same dots that appears in the first plot. Any ideas? I’ve already tried many approaches but without success!

Cheers,  
Tiago

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [September 10, 2019, 4:59pm UTC](https://discourse.julialang.org/t/how-to-mark-specific-points-in-a-contour-plot-using-plots-jl/28616/2 "2019-09-10T16:59:10Z")

</div>

I don’t understand why you can’t just do the exact same thing?

---

<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:** [September 11, 2019, 7:51am UTC](https://discourse.julialang.org/t/how-to-mark-specific-points-in-a-contour-plot-using-plots-jl/28616/3 "2019-09-11T07:51:29Z")

</div>

More specifically, this works for me:

```julia
V(x,y) = x^2 + y^2
x = -10:0.5:10
y = -10:0.5:10
contour(x,y, (x,y)->V(x,y), levels=30)
scatter!(rand(-10:2:10, 10), [0 for _ in 1:10],label="Some points")

```

gives:  
 ![contour](https://global.discourse-cdn.com/julialang/original/3X/d/e/de472d47d30ce115b44cb172547188cc5626c19d.png)
