Gmt psxy

Hi every one, i am new here and i need your help please !

So I am a student in geology at master degree, and I am doing an internship about gravity variation.
I am a new user of GMT, and I am not afraid to say I am a very big noob.
I have to make a map with gravity variation from airbone data. I followed tutorials to create a map, and I used psbasemap and pscoast successfully. But now I have to add points and each point have to represent gravity value. The problem is these values are in txt file and i don’t know how i can call my data from this file. In my file they are many columns like location in rad time altitude etc…is if someone can help me I will appreciate it ( sorry for my broken English )

Depends on the format. If you have longitude and latitude in columns a and b and your gravity value in column c (and a, b,c are not the three first columns 0, 1, 2) then you need to use -i to select which columns you want.

1 Like

Thank you for your answer, after many try I found how I can do it : actually I used “awk” to extract columns on new file like this :

awk '{print $3 ,$2, $7}' $ datafile.txt > gravipoints.txt.

Each $ followed by number matches with a column in original data files after, i used

gmt psxy gravipoints.txt -R -JQ -Sc0.09 -C$CPT -O -K -X -Y  >> $PLOT

to get map with points .

The recommendation was to use the option -i. More elegant

gmt psxy gravipoints.txt -i2,1,6 -R -JQ -Sc0.09 -C$CPT -O -K >> $PLOT
1 Like

Thank you very much Joaquim I appreciate your help, in deed it’s quicker and more elegant.