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
Please see plot -F option for how to create various groups or networks from individual input points.
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. 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:
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:
Thanks so much, let me try it out
@yvonnefroehlich thanks so much for this information, I will go ahead and try it out. Thanks again.

