# How to plot many hypocenters joined with lines

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-plot-many-hypocenters-joined-with-lines/1591>\
**Category:** Q&A\
**Created:** [April 19, 2021, 8:02pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-many-hypocenters-joined-with-lines/1591 "2021-04-19T20:02:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadiamacare.na](https://avatars.discourse-cdn.com/v4/letter/n/eada6e/32.png) [@nadiamacare.na](https://forum.generic-mapping-tools.org/u/nadiamacare.na)\
**Post date:** [April 19, 2021, 8:02pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-many-hypocenters-joined-with-lines/1591/1 "2021-04-19T20:02:05Z")

</div>

![lineas.PNG](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/e/e182ba88e46a961ed22e3c6ebaca0f541fc303f3.jpeg)

Hello everyone,

I need to plot 2 circles of different color, the red color represents the hypocenter located by one network, while the blue circle represents the hypocenter located by another network. These must be joined by a line to identify that we are visualizing the same event as the circles in the image attached.  
I tried this code, but I can only plot one hypocenter and not the amount that i need and also i can’t change the colors of the circles:

psxy data.txt -R -J -O -K -W1 -Sc.3 -G255/0/0 \>\> $ {region} .ps  
psxy data.txt -R -J -O -K -W5 /0/0/255 \>\> $ {region} .ps

I would be very grateful for your help,

Nadia

---

<div class="post-metadata">

**Author:** ![maxrjones](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/maxrjones/32/2698_2.png) [@maxrjones](https://forum.generic-mapping-tools.org/u/maxrjones)\
**Post date:** [April 19, 2021, 8:56pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-many-hypocenters-joined-with-lines/1591/2 "2021-04-19T20:56:05Z")

</div>

Can you post a few lines from data.txt to show how it is formatted?

---

<div class="post-metadata">

**Author:** ![nadiamacare.na](https://avatars.discourse-cdn.com/v4/letter/n/eada6e/32.png) [@nadiamacare.na](https://forum.generic-mapping-tools.org/u/nadiamacare.na)\
**Post date:** [April 19, 2021, 9:11pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-many-hypocenters-joined-with-lines/1591/3 "2021-04-19T21:11:52Z")

</div>

Of course,

-71.3932 -53.3570  
-71.6950 -53.3785

---

<div class="post-metadata">

**Author:** ![maxrjones](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/maxrjones/32/2698_2.png) [@maxrjones](https://forum.generic-mapping-tools.org/u/maxrjones)\
**Post date:** [April 20, 2021, 4:41pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-many-hypocenters-joined-with-lines/1591/4 "2021-04-20T16:41:57Z")

</div>

Are the hypocenters from the two networks in the same file or separate files?

A couple simple comments about the example code:  
`psxy data.txt -R -J -O -K -W5 /0/0/255 >> $ {region} .ps`  
`-G` is missing before `0/0/255` for setting the fill color. e.g., `-G0/0/255`.  
`-S` is missing for setting the symbol. Without `-S`, GMT expects to find the sizes and symbol as data columns in `data.txt`.

---

<div class="post-metadata">

**Author:** ![nadiamacare.na](https://avatars.discourse-cdn.com/v4/letter/n/eada6e/32.png) [@nadiamacare.na](https://forum.generic-mapping-tools.org/u/nadiamacare.na)\
**Post date:** [April 20, 2021, 8:02pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-many-hypocenters-joined-with-lines/1591/5 "2021-04-20T20:02:22Z")

</div>

![dif_evs](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/b/b30d72ab7f1d5955fd8c3e48abda705ba024f877.png)

In this case, to get the following image I ordered the data this way:

Longitude 1 Latitude 1  
Longitude 2 Latitude 2

Thanks for the correction! but when adding the -S I don’t get the line that joins both circles

---

<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 20, 2021, 8:27pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-many-hypocenters-joined-with-lines/1591/6 "2021-04-20T20:27:26Z")

</div>

-S it is just to plot a symbol. The line is drawn with -W.  
You can use both and you will get a line and a circle (or another symbol).  
If you use only -S you will get a symbol and if you only use -W you will get a line.
