# Simple highlighting of countries

**URL:** <https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857>\
**Category:** Showcase\
**Created:** [April 28, 2022, 7:30am UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857 "2022-04-28T07:30:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [April 28, 2022, 7:30am UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/1 "2022-04-28T07:30:55Z")

</div>

```auto
#!/usr/bin/env bash

# one or more comma-separated countries
# see https://docs.generic-mapping-tools.org/dev/coast.html#e
countries="NO,UA,IS,IE,DE"

gmt begin highlighted-countries png

gmt set GMT_THEME minimal

gmt grdimage @earth_relief_10m -JM20c -R$countries -t50
gmt coast -E$countries+C
gmt basemap -B+gblack@40
gmt coast -Q
gmt coast -Na -Baf -B+t"Highlighted countries"

gmt end

```

 ![highlighted-countries](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/f/ffff737568fcba32ac13f47131704b666ef76dd9.png)

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [April 28, 2022, 2:40pm UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/2 "2022-04-28T14:40:56Z")

</div>

Is there a way to smooth the borders?

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [April 28, 2022, 2:52pm UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/3 "2022-04-28T14:52:23Z")

</div>

No, the DCW comes in one resolution.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [April 28, 2022, 3:30pm UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/4 "2022-04-28T15:30:03Z")

</div>

What do you mean? To reduce the numbers of points that define the borders (i.e. to have a lower resolution line)?

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [April 28, 2022, 8:58pm UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/5 "2022-04-28T20:58:25Z")

</div>

Nah, more like a fuzzy contour (maybe some gaussian filtering near the border or something)

…Or just some shading using a slightly different -J, -X and -Y?

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [April 28, 2022, 10:40pm UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/6 "2022-04-28T22:40:49Z")

</div>

I think I don’t fully understand you. Would you share an example?

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [May 5, 2022, 6:42am UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/7 "2022-05-05T06:42:49Z")

</div>

I thought I was doing groundbreaking stuff here. Guess not.

See also:

- [(34) Using country polygons for plotting and shading](https://docs.generic-mapping-tools.org/dev/gallery/ex34.html#example-34)
- [(53) Building subplots and using per-country shading](https://docs.generic-mapping-tools.org/dev/gallery/ex53.html#example-53)

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [May 5, 2022, 7:37am UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/8 "2022-05-05T07:37:59Z")

</div>

Yours is better 👍

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [May 5, 2022, 8:01am UTC](https://forum.generic-mapping-tools.org/t/simple-highlighting-of-countries/2857/9 "2022-05-05T08:01:56Z")

</div>

Thanks PlanetGus 🙂
