# Ray paths coverage

**URL:** <https://forum.generic-mapping-tools.org/t/ray-paths-coverage/3603>\
**Category:** Q&A\
**Created:** [January 11, 2023, 11:12am UTC](https://forum.generic-mapping-tools.org/t/ray-paths-coverage/3603 "2023-01-11T11:12:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlbertSeismo](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/albertseismo/32/2770_2.png) [@AlbertSeismo](https://forum.generic-mapping-tools.org/u/AlbertSeismo)\
**Post date:** [January 11, 2023, 11:12am UTC](https://forum.generic-mapping-tools.org/t/ray-paths-coverage/3603/1 "2023-01-11T11:12:30Z")

</div>

![WhatsApp Image 2022-05-05 at 00.29.28](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/0/081f7354bc6d1e07f831dc1f77d0bd2339c67774.jpeg)

Hi I am using Mac, and pygmt. I am looking to create a coverage map like the one attached (not mine, i found it on this forum and used it for reference here). I have 20 stations and I would like to compute that coverage and plot it directly on a pygmt map. What i am struggling with so far is a list of interstation coordinates i computed, but i can’t plot them on a pygmt map using a loop, but i can if its a matplotlib plot. Can someone please guide me how to do this? I have seen some people importing like ‘file.geo’ file that contains all coordinates, but i am not sure how to create such a .geo file. I would appreciate.  
regards  
Albert

---

<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:** [January 11, 2023, 12:18pm UTC](https://forum.generic-mapping-tools.org/t/ray-paths-coverage/3603/2 "2023-01-11T12:18:30Z")

</div>

Please see **plot -F** option for how to create various groups or networks from individual input points.

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [January 12, 2023, 6:52am UTC](https://forum.generic-mapping-tools.org/t/ray-paths-coverage/3603/3 "2023-01-12T06:52:47Z")

</div>

Hello @AlbertSeismo,

Welcome to the GMT forum!

As mentioned by @pwessel creating such a “coverage map” can be accomplished by using the **-F** option of the `plot` module. You only need your station coordinates, and then GMT can compute and plot a “network” between the stations for you 🙂. The alias for **-F** in PyGMT is `connection`, for details you may want to have a look at the documentation at [pygmt.Figure.plot — PyGMT](https://www.pygmt.org/v0.8.0/api/generated/pygmt.Figure.plot.html). Below you find a small code example based on random station locations. Maybe it can serve as an orientation, and you can adjust it for your needs and data.

_Code example_:

```python
import pygmt

# some random station coordinats
lon_sta = [-5, -2, -4, -4, -7, -2] # longitude
lat_sta = [32, 34, 35, 33, 33, 32] # latitue

# create figure object
fig = pygmt.Figure()

fig.basemap(
    region= [-8, -1, 31, 37],
    projection="M10c",
    frame="af",
)

fig.coast(
    shorelines="1/1p,black",
    land="gray70",
    water="lightblue",
)

# plot symbols for stations
fig.plot(
    x=lon_sta,
    y=lat_sta,
    style="i0.5c", # inverse triangles
    fill="blue",
    pen="1p,black",
)

# plot lines between stations
# source: https://www.pygmt.org/v0.8.0/api/generated/pygmt.Figure.plot.html
# last access: 2023/01/11
fig.plot(
    x=lon_sta,
    y=lat_sta,
    pen="1p,seagreen",
    connection="n", # network
)

fig.show()
# fig.savefig(fname="ray_coverage.png")

```

_Output figure_:

 ![ray_coverage](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/7cd9425124d4c97e1c8161533b7a11a1057d2b54.png)

---

<div class="post-metadata">

**Author:** ![AlbertSeismo](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/albertseismo/32/2770_2.png) [@AlbertSeismo](https://forum.generic-mapping-tools.org/u/AlbertSeismo)\
**Post date:** [January 22, 2023, 5:29pm UTC](https://forum.generic-mapping-tools.org/t/ray-paths-coverage/3603/4 "2023-01-22T17:29:22Z")

</div>

Thanks so much, let me try it out

---

<div class="post-metadata">

**Author:** ![AlbertSeismo](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/albertseismo/32/2770_2.png) [@AlbertSeismo](https://forum.generic-mapping-tools.org/u/AlbertSeismo)\
**Post date:** [January 22, 2023, 5:30pm UTC](https://forum.generic-mapping-tools.org/t/ray-paths-coverage/3603/5 "2023-01-22T17:30:21Z")

</div>

@yvonnefroehlich thanks so much for this information, I will go ahead and try it out. Thanks again.
