# Scatter plot over a map

**URL:** <https://discourse.julialang.org/t/scatter-plot-over-a-map/106165>\
**Category:** New to Julia\
**Tags:** plotting, gmt\
**Created:** [November 13, 2023, 10:20pm UTC](https://discourse.julialang.org/t/scatter-plot-over-a-map/106165 "2023-11-13T22:20:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yalonso](https://avatars.discourse-cdn.com/v4/letter/y/59ef9b/32.png) [@yalonso](https://discourse.julialang.org/u/yalonso)\
**Post date:** [November 13, 2023, 10:20pm UTC](https://discourse.julialang.org/t/scatter-plot-over-a-map/106165/1 "2023-11-13T22:20:31Z")

</div>

Hello,

I am trying to use GMT.jl to plot some points overtop a map of a region of the U.S… I can get the map to show, but when I try to scatter points over it, I’m getting an error message. Any help here would be much appreciated – I am new to Julia, thank you!

```julia
function example()
    coast(region=[-123.4, -121, 36.7, 38.3], proj=:Mercator, frame=:g, area=10000, land=:gray, water=:white, show=true)

    longitudes = [-122.31441247906619, -122.09929770009289, -121.30891030707745]
    latitudes = [37.395990554112785, 37.37364347711264, 37.18752179269895]

    GMT.scatter!(
        longitudes, 
        latitudes, 
        fmt=:png, 
        marker=:circle,
        markeredgecolor=:black,
        size=0.1,  
        markerfacecolor=:cyan,
        show=true
    )
end

```

The error message is:  
ERROR: Something went wrong when calling the module. GMT error number = 79

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 13, 2023, 10:37pm UTC](https://discourse.julialang.org/t/scatter-plot-over-a-map/106165/2 "2023-11-13T22:37:45Z")

</div>

You are using the `show` option twice when you should use it only at the last command. The `scatter!` call means append to a previous plot but there is no previous one because you finished it when you used `show` in the `coast` call.

This works:

```julia
coast(region=[-123.4, -121, 36.7, 38.3], proj=:Mercator, frame=:g, area=10000,
      land=:gray, water=:white)
scatter!([-122.31, -122.1, -121.3], [37.396, 37.37, 37.18], marker=:circle,
         markeredgecolor=:black, markerfacecolor=:cyan, size=0.1, show=true)

```

 ![GMTjl_j](https://global.discourse-cdn.com/julialang/original/3X/6/d/6d8fc682954f7f14f3ac71efc11acd3e135f1326.png)

---

<div class="post-metadata">

**Author:** ![yalonso](https://avatars.discourse-cdn.com/v4/letter/y/59ef9b/32.png) [@yalonso](https://discourse.julialang.org/u/yalonso)\
**Post date:** [November 15, 2023, 4:59pm UTC](https://discourse.julialang.org/t/scatter-plot-over-a-map/106165/3 "2023-11-15T16:59:02Z")

</div>

Thank you so much!
