# Use of psxy to plot earthquake magnitude on Map

**URL:** <https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385>\
**Category:** Q&A\
**Created:** [April 16, 2020, 11:20am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385 "2020-04-16T11:20:57Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [April 19, 2020, 5:55am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/21 "2020-04-19T05:55:39Z")

</div>

> [@John](#):
>
> gmt psxy vol\_IndianO.txt -R93/109/-17/-1 -JM6i -Sf0.25+t -Gpurple -B4 -W0.2p -K -O \> result.ps and  
> gmt psxy vol\_IndianO.txt -R93/109/-17/-1 -JM6i -Stp -Gpurple -B4 -W0.2p -K -O \> results.ps and other

These are few out of many script I used  
gmt psxy vol\_IndianO.txt -R93/109/-17/-1 -JM6i -Sf0.25+t -Gpurple -B4 -W0.2p -K -O \> result.ps and  
gmt psxy vol\_IndianO.txt -R93/109/-17/-1 -JM6i -Stp -Gpurple -B4 -W0.2p -K -O \> results.ps

---

<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 19, 2020, 6:10am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/22 "2020-04-19T06:10:04Z")

</div>

Try -St0.25c. I think it should work.

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [April 19, 2020, 7:05am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/23 "2020-04-19T07:05:39Z")

</div>

thank Sir, I will try this on Monday in my office, office closed on Sunday here. Am grateful Sir

---

<div class="post-metadata">

**Author:** ![mgrund](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mgrund/32/139_2.png) [@mgrund](https://forum.generic-mapping-tools.org/u/mgrund)\
**Post date:** [April 19, 2020, 12:49pm UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/24 "2020-04-19T12:49:17Z")

</div>

As @Esteban82 wrote `-Sf ... +t` is used to plot fault zones or subduction zones with the triangles pointing in the defined direction. To plot single triangles at the specified location `-St0.25` is the way to go. If you want to plot a custom volcano symbol e.g. see http://gmt.soest.hawaii.edu/doc/latest/gallery/ex20.html.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 19, 2020, 4:24pm UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/25 "2020-04-19T16:24:40Z")

</div>

The problem is the data file format with non **# headers** and no **-h** option, pipes as field separators, etc. This has been called to attention two times before but …

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [April 20, 2020, 6:42am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/26 "2020-04-20T06:42:21Z")

</div>

You are right Sir, thanks for the reminder, I will keep this in mind. It was appended in my interpolated data actually not the global derived data.

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [April 20, 2020, 6:43am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/27 "2020-04-20T06:43:32Z")

</div>

@mgrund, Hello Prof. many thanks it worked, am very grateful

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [April 20, 2020, 6:44am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/28 "2020-04-20T06:44:11Z")

</div>

Yes Sir, it worked with your suggestion, many thanks, am very grateful

---

<div class="post-metadata">

**Author:** ![John](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john/32/40_2.png) [@John](https://forum.generic-mapping-tools.org/u/John)\
**Post date:** [April 20, 2020, 6:45am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/29 "2020-04-20T06:45:56Z")

</div>

> [@mgrund](#):
>
> [http://gmt.soest.hawaii.edu/doc/latest/gallery/ex20.html](http://gmt.soest.hawaii.edu/doc/latest/gallery/ex20.html).

this link is either broken or unable to open

---

<div class="post-metadata">

**Author:** ![mgrund](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mgrund/32/139_2.png) [@mgrund](https://forum.generic-mapping-tools.org/u/mgrund)\
**Post date:** [April 20, 2020, 6:57am UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/30 "2020-04-20T06:57:10Z")

</div>

just copy/paste it …

---

<div class="post-metadata">

**Author:** ![bilalseismologist](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bilalseismologist](https://forum.generic-mapping-tools.org/u/bilalseismologist)\
**Post date:** [February 19, 2023, 4:25pm UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/31 "2023-02-19T16:25:41Z")

</div>

hello,  
Im also new and trying to plot a map with earthquake data. Using gmt 6.4 and the code:

gmt begin magtar450 png  
gmt coast -R71/76/33.3/36.5 -JM10i -C -Ba1f1 -W1 -G224/240/200 -Lf71.7/33.50/33.50/100+lkm -TdjTR+f+w1i -N1 -W1 -DlBC+o0/0.35i+w4.5i/0.1i+h

gmt psxy mag450km.txt -JM10i -Scp -i0,1,3+s2 -Z -Cmag.cpt  
gmt psscale -DjRB+w1.5i/0.5c+o1/1c -Cmag.cpt -Baf  
…the code goes on to make the map

 ![magtar450](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/5/55db0582686fcbf0c3ecb6f775c72fcc53c97072.png)

I want to make the map plot earthquake events with size and color from txt file as seen in magnitude colorscale.  
the data file has data as:  
75.00 34.00 2.6  
76.33 33.00 3.4  
with no headers in text file and as longitude latitude and magnitude only.  
Cant get the circle fill according to the magnitude defined in cpt file.

---

<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:** [February 19, 2023, 4:39pm UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/32 "2023-02-19T16:39:06Z")

</div>

Perhaps you should not reference a non-existent column 3 since you only have column 0-2 to play with?

---

<div class="post-metadata">

**Author:** ![bilalseismologist](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bilalseismologist](https://forum.generic-mapping-tools.org/u/bilalseismologist)\
**Post date:** [February 19, 2023, 4:57pm UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/33 "2023-02-19T16:57:17Z")

</div>

Thanks for the quick response.  
OK. since I’m trying to figure out what part of code I’ve done wrong. Can you tell what to write exactly to get color and size of magnitude as per column 3 of text file?!

---

<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:** [February 19, 2023, 6:21pm UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/34 "2023-02-19T18:21:41Z")

</div>

I would try

`gmt psxy mag450km.txt -JM10i -Scp -i0,1,2,2+s2 -Cmag.cpt`

i.e., use the magnitude column twice; both to look up colour and to set the size. But I think scaling your magnitudes by 2 will give pretty large symbols in cm, like 5.2, 6.8 cm etc. Perhaps you wish to change that.

---

<div class="post-metadata">

**Author:** ![bilalseismologist](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bilalseismologist](https://forum.generic-mapping-tools.org/u/bilalseismologist)\
**Post date:** [February 19, 2023, 8:09pm UTC](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385/35 "2023-02-19T20:09:08Z")

</div>

It worked!!! Thank you so much, I’ve been at it for a few days. I did test scaling the magnitude size and s2 is the right size for my map.

[Previous page](https://forum.generic-mapping-tools.org/t/use-of-psxy-to-plot-earthquake-magnitude-on-map/385.md?page=1)
