# How could I create map with colored countries?

**URL:** <https://discourse.julialang.org/t/how-could-i-create-map-with-colored-countries/75634>\
**Category:** Visualization\
**Tags:** geo, gis, gmt\
**Created:** [February 2, 2022, 8:49am UTC](https://discourse.julialang.org/t/how-could-i-create-map-with-colored-countries/75634 "2022-02-02T08:49:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maajdl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maajdl/32/22838_2.png) [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Post date:** [February 2, 2022, 8:49am UTC](https://discourse.julialang.org/t/how-could-i-create-map-with-colored-countries/75634/1 "2022-02-02T08:49:44Z")

</div>

Hello

Below is the kind of maps I would like to draw.  
The colors would be changing according to some data.  
I would dream of making animated gif files on this basis.

Any idea how I coul proceed?

Thanks

Michel

 ![10.1177_00368504211021232-fig1](https://global.discourse-cdn.com/julialang/original/3X/b/0/b0eecddd61568e5f3488faed4aac29ce48b5da78.jpeg)

---

<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:** [February 2, 2022, 9:22am UTC](https://discourse.julialang.org/t/how-could-i-create-map-with-colored-countries/75634/2 "2022-02-02T09:22:55Z")

</div>

GMT.jl can be used for this. See for instance the [`coast()` function doc](https://github.com/GenericMappingTools/GMT.jl/blob/master/docs/src/coast.md).

---

<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:** [February 2, 2022, 1:28pm UTC](https://discourse.julialang.org/t/how-could-i-create-map-with-colored-countries/75634/3 "2022-02-02T13:28:55Z")

</div>

See also  
[https://www.generic-mapping-tools.org/GMT.jl/dev/gallery/choropleths/choropleth\_DCW/](https://www.generic-mapping-tools.org/GMT.jl/dev/gallery/choropleths/choropleth_DCW/)

---

<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:** [February 2, 2022, 2:00pm UTC](https://discourse.julialang.org/t/how-could-i-create-map-with-colored-countries/75634/4 "2022-02-02T14:00:58Z")

</div>

One quick example using GMT.jl:

 ![GMT_worldmap_country_colors](https://global.discourse-cdn.com/julialang/original/3X/1/4/146e6b788eb72e82eb34ba6299d1ca0e52e86424.png)

> **Julia code**
>
> ```julia
> using GMT
> coast(region=(-180, 180, -60, 80), proj=:merc,
> land=:white, water=:lightblue, figsize=15,
> shore=:thinnest,
> frame=(annot=20, grid=20,ticks=20),
> par=(FONT_ANNOT_PRIMARY=5,) 
> )
> c1 = (country=:US, pen=(0.1,:darkgreen), fill=:lightgreen)
> c2 = (country=:RU, pen=(0.1,:red), fill=:pink)
> countries = tuple(c1,c2)
> coast!(DCW= countries, fmt=:png, show=true)
> 
> ```

---

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [February 2, 2023, 2:45pm UTC](https://discourse.julialang.org/t/how-could-i-create-map-with-colored-countries/75634/5 "2023-02-02T14:45:05Z")

</div>

Is this possible with VegaLite.jl and Vegadatasets?

---

<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:** [February 2, 2023, 3:01pm UTC](https://discourse.julialang.org/t/how-could-i-create-map-with-colored-countries/75634/6 "2023-02-02T15:01:04Z")

</div>

@Mastomaki, there is [one example here](https://discourse.julialang.org/t/how-to-change-the-country-name-and-then-draw-the-global-map/88076/20) that could be a good starting point.
