# Plotting points on a map

**URL:** <https://discourse.julialang.org/t/plotting-points-on-a-map/77284>\
**Category:** New to Julia\
**Tags:** plotting, gmt\
**Created:** [March 2, 2022, 9:38am UTC](https://discourse.julialang.org/t/plotting-points-on-a-map/77284 "2022-03-02T09:38:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaWa](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@DaWa](https://discourse.julialang.org/u/DaWa)\
**Post date:** [March 2, 2022, 9:38am UTC](https://discourse.julialang.org/t/plotting-points-on-a-map/77284/1 "2022-03-02T09:38:41Z")

</div>

Hello all,

I have some points, (longitudes and latitudes) placed in germany/european union. I want to plot them with an underlying outline of the country/countries.

Currently I am using plots with the gr backend, and it would be awesome if I could get using plots it. But any help, using other packages aswell would be very helpfull.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [March 2, 2022, 3:03pm UTC](https://discourse.julialang.org/t/plotting-points-on-a-map/77284/2 "2022-03-02T15:03:16Z")

</div>

I do mine with Luxor

[http://juliagraphics.github.io/Luxor.jl/stable/](http://juliagraphics.github.io/Luxor.jl/stable/)

Here’s the ceiling house price of 1.7m postcodes in England / Wales.

 ![priced_cropped](https://global.discourse-cdn.com/julialang/original/3X/1/b/1b2f4975a5c04f182557a5d7684020e029c86453.jpeg)

---

<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:** [March 2, 2022, 3:20pm UTC](https://discourse.julialang.org/t/plotting-points-on-a-map/77284/3 "2022-03-02T15:20:16Z")

</div>

Maps need projections  
[GMT.jl](https://github.com/GenericMappingTools/GMT.jl)

---

<div class="post-metadata">

**Author:** ![DaWa](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@DaWa](https://discourse.julialang.org/u/DaWa)\
**Post date:** [March 4, 2022, 2:35pm UTC](https://discourse.julialang.org/t/plotting-points-on-a-map/77284/4 "2022-03-04T14:35:05Z")

</div>

Thanks to both of you for the reply. I manged to get a plot using gmt. The code I used is

```julia
coast(
    region="0/30/20/60+r", 
    proj=(name=:laea, center=[10,50]), 
    frame=:ag, 
    res=:low,
    area=500, 
    shore=:thin, 
    borders=1,
    
    # outline germany in red
    DCW=((country="DE", 
            pen=(1,:red))),
    figsize=10
)
GMT.scatter!(
    longitudes, latitudes, 
    fmt=:png, 
    marker=:circle,
    markeredgecolor=0, 
    size=0.1, 
    markerfacecolor=:cyan, 
    show=true
)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/0/d/0d533edddd420045263a66b6bcf5f205760cce11.png)

Does anyone have an idea how to make convert this to a histogram style plot? Colorcoding the amount of points rather than plotting all of them individually?

---

<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:** [March 5, 2022, 1:16am UTC](https://discourse.julialang.org/t/plotting-points-on-a-map/77284/5 "2022-03-05T01:16:06Z")

</div>

Try the [blockmean](https://www.generic-mapping-tools.org/GMT.jl/dev/blockmean/) module to compute the 2D histogram (use the `statistics` option) grid and use it like in this [bar3D example](https://www.generic-mapping-tools.org/GMT.jl/dev/gallery/scripts_agu/bars3_peaks/)
