# Psxy not working with -O and -K

**URL:** <https://forum.generic-mapping-tools.org/t/psxy-not-working-with-o-and-k/576>\
**Category:** Q&A\
**Created:** [June 23, 2020, 9:39am UTC](https://forum.generic-mapping-tools.org/t/psxy-not-working-with-o-and-k/576 "2020-06-23T09:39:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harold\_Ulotu](https://avatars.discourse-cdn.com/v4/letter/h/3ab097/32.png) [@Harold\_Ulotu](https://forum.generic-mapping-tools.org/u/Harold_Ulotu)\
**Post date:** [June 23, 2020, 9:39am UTC](https://forum.generic-mapping-tools.org/t/psxy-not-working-with-o-and-k/576/1 "2020-06-23T09:39:22Z")

</div>

Hello everyone,  
I have been having a hard time using psxy recently. I have a text file (gravstn.txt) with Lon and Lat values and I wish to plot them on the map of Tanzania. Here’s the code:

gmt pscoast -R25/45/-15/5 -JM6i -L28/-14+c-14+w500k+u+f -Ba5g5 -Dh -N1/0.5p -W1p -Gwhite -Scornflowerblue -K \> map.ps  
gmt psxy gravstn.txt -R25/45/-15/5 -JM6i -Sc0.002c -Gred -Ba5g5 -O \> map.ps  
gmt psconvert map.ps -A -Tg

Here’s the file:  
[gravstn.zip](https://forum.generic-mapping-tools.org/uploads/short-url/k3Ygy9GFcmqm6vewHBNW2FQSbBP.zip) (237.7 KB)

When I run the code, I get the following message:  
[error\_message.zip](https://forum.generic-mapping-tools.org/uploads/short-url/96uFSlQGBMtmiSqN66sm9oIAB9E.zip) (732 Bytes)

Does anyone know the solution to this problem?  
Best regards,  
Harold.

---

<div class="post-metadata">

**Author:** ![tmerry](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@tmerry](https://forum.generic-mapping-tools.org/u/tmerry)\
**Post date:** [June 23, 2020, 10:46am UTC](https://forum.generic-mapping-tools.org/t/psxy-not-working-with-o-and-k/576/2 "2020-06-23T10:46:47Z")

</div>

You need a \>\> instead of \> on your second line to append to the ps file rather than create a new ps file.

gmt psxy gravstn.txt -R25/45/-15/5 -JM6i -Sc0.002c -Gred -Ba5g5 -O \>\> map.ps

---

<div class="post-metadata">

**Author:** ![Harold\_Ulotu](https://avatars.discourse-cdn.com/v4/letter/h/3ab097/32.png) [@Harold\_Ulotu](https://forum.generic-mapping-tools.org/u/Harold_Ulotu)\
**Post date:** [June 23, 2020, 11:03am UTC](https://forum.generic-mapping-tools.org/t/psxy-not-working-with-o-and-k/576/3 "2020-06-23T11:03:36Z")

</div>

Thank you. It has worked !
