Colored background of "psrose"

Hi everyone,

I tried to show the back-azimuths of the earthquakes in a circular plot (by adding the line for an individual event) using the “psrose” command.

Is it possible to make a background color by considering the number of data (for a specific .cpt file)?

Here I am adding a small gmt script and, two different .txt files for the two stations. I would like to fill the background of the circles by considering the number of data inside the .txt files.

Can you please share your thoughts on this topic?

Thanks in advance,

gmt psrose 4_data.txt -R0/1.2/0/360 -S3c -L -Bwens -W0.25 -K > out.ps
gmt psrose 7_data.txt -R0/1.2/0/360 -S3c -L -Bwens -W0.25 -K -O -X8 >> out.ps

5_data.txt (2.5 KB) 7_data.txt (154 Bytes)

I guess you would need to write in your file that information somehow in order for the cpt mechanism to take place.

Maybe a simple “wc -l” then “awk” (or “paste” or “sed”…)?

Thank you,
Do you mention that the third column in the .txt file will be the number of rows of these .txt files?

I added 207 and 12 into the third column of the 5_data.txt and 7_data.txt files, respectively. Then I just manipulate the gmt command as follows to see the result quickly.

cat 5_data.txt | awk ‘{print $1,$2" 12"}’ | gmt psrose -R0/1.2/0/360 -S3c -L -Bwens -W0.25 -K -Ccolor.cpt -A > out.ps

cat 7_data.txt | awk ‘{print $1,$2" 207"}’ | gmt psrose -R0/1.2/0/360 -S3c -L -Bwens -W0.25 -K -O -X8 -Ccolor.cpt -A >> out.ps

It still did not work.

Hm, I see.

There’s an ugly trick if you want. It consists in adding a small decimal to the first column value. The decimal would be the count in that case.

1 55
1 48
...

becomes

1.01 55
1.01 48
...

Then you create a cpt: -T1/1.1/0.01