# How to clip data outside the circle

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-clip-data-outside-the-circle/1602>\
**Category:** Q&A\
**Created:** [April 23, 2021, 3:16pm UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-data-outside-the-circle/1602 "2021-04-23T15:16:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zubair1](https://avatars.discourse-cdn.com/v4/letter/z/53a042/32.png) [@zubair1](https://forum.generic-mapping-tools.org/u/zubair1)\
**Post date:** [April 23, 2021, 3:16pm UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-data-outside-the-circle/1602/1 "2021-04-23T15:16:58Z")

</div>

Hello everyone,

I am new to the GMT and I have to plot the colorful contours to show my data. I am using grdimage for contouring the map the circle with 200 km radius is drawn using following command  
gmt psxy Site.txt $LIM $Proj -Sc -SE-400k -W1p,white.

I think it is not an efficient way but unfortunately, I do not know any other way.  
Can anybody please help me how to clip/trim/cut data outside the circle? should only show the contours inside white circle.

thank you!

Zubair

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

---

<div class="post-metadata">

**Author:** ![volkerk](https://avatars.discourse-cdn.com/v4/letter/v/9d8465/32.png) [@volkerk](https://forum.generic-mapping-tools.org/u/volkerk)\
**Post date:** [April 23, 2021, 4:52pm UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-data-outside-the-circle/1602/2 "2021-04-23T16:52:14Z")

</div>

Just use gmt clip wher you can provide the contour defining the region to be clipped. May be you can directly specify a circle, in the clip command but there I am not sure.

---

<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, 2021, 3:36pm UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-data-outside-the-circle/1602/3 "2021-04-28T15:36:01Z")

</div>

Have a look at `clip` module.

An example [here](https://flint.soest.hawaii.edu/t/how-to-create-a-heatmap/1478).

```auto
	gmt clip $region $projection gbas.txt
	gmt grdimage gridded.nc -C -B+t"# events per area"
	gmt clip -C

```
