# How to plot a text file of points

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-plot-a-text-file-of-points/4508>\
**Category:** Q&A\
**Created:** [December 11, 2023, 3:43pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-a-text-file-of-points/4508 "2023-12-11T15:43:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahsa](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@Mahsa](https://forum.generic-mapping-tools.org/u/Mahsa)\
**Post date:** [December 11, 2023, 3:43pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-a-text-file-of-points/4508/1 "2023-12-11T15:43:47Z")

</div>

I have a text file with latitude and longitude of some points. How can I plot them with including political boundaries?

---

<div class="post-metadata">

**Author:** ![chhei-s](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/chhei-s/32/1028_2.png) [@chhei-s](https://forum.generic-mapping-tools.org/u/chhei-s)\
**Post date:** [December 12, 2023, 10:17am UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-a-text-file-of-points/4508/2 "2023-12-12T10:17:01Z")

</div>

Hi @Mahsa

you’d need two GMT calls to do this:

1. generate a basemap with `gmt coast` with an appropriate choice for the [`-N` option](https://docs.generic-mapping-tools.org/latest/coast.html#n)
2. plot your points with `gmt plot`, using [a symbol](https://docs.generic-mapping-tools.org/latest/plot.html#s) (`-S`). If the data is `latitude longitude` then you’d have to change the input column read order using the [`-i` option](https://docs.generic-mapping-tools.org/latest/gmt.html#icols-full).

So a script could look like this:

```
gmt begin
gmt figure YourFigure pdf
gmt coast -R<your region/AOI> -J<your choice of projection> -N1 -B
gmt plot <YourPointsFile> -Sc0.4 -Gred
gmt end

```

Cheers,  
Christian
