Seriestime GMT

Hello everyone

gmt begin series_times pdf,png

gmt set GMT_THEME cookbook

gmt set FORMAT_DATE_MAP=-o FONT_ANNOT_PRIMARY +9p

gmt set GMT_LANGUAGE IT

gmt set IO_COL_SEPARATOR=tab

gmt info C:\programs\DATA_MAGNITUDO.txt

gmt plot C:\programs\DATA_MAGNITUDO.txt -Sc0.15c -Gcoral -R2006-01-08T/2021-01-04T/1.2/4.1 -Bxafg+l"Time" -Byafg+l"Magnitude"

gmt end show

this is my script.
And I get this


But ins’t good because no rappresent all data!

This is a part of my .txt file

2006-01-08 13.23.43.720 2.0
2006-01-08 13.26.27.290 2.8
2006-01-08 13.27.17.850 2.2
2006-01-08 13.28.03.070 2.7
2006-01-08 13.32.02.560 2.2
2006-01-08 13.33.10.440 2.9
2006-01-08 13.55.45.490 2.7
2006-01-08 13.59.56.090 2.9
2006-01-08 14.54.26.450 1.9
2006-01-08 15.08.49.580 2.5
2006-01-08 16.09.24.170 3.7
2006-01-08 17.12.40.840 2.9
2006-01-08 17.21.57.820 2.9
2006-01-08 17.53.47.220 2.1
2006-01-08 18.21.21.780 2.3
2006-01-08 18.56.56.430 2.7
2006-01-09 01.15.59.300 1.9
2006-05-20 05.50.44.150 2.5
2006-05-20 05.56.39.130 3.0
2006-05-20 05.58.47.620 2.2
2006-05-20 06.00.04.390 1.8
2006-05-20 06.02.26.750 2.0
2006-05-20 06.04.16.950 2.0
2006-05-20 06.05.59.320 3.1
2006-05-20 06.07.51.310 1.7
2006-05-20 06.08.13.850 2.4
2006-05-20 06.09.22.340 1.2
2006-05-20 06.11.37.800 2.0
2006-05-20 06.12.34.430 1.7
2006-05-20 06.19.23.220 2.1
2006-05-20 06.26.20.150 1.9
2006-05-20 06.27.12.770 1.5
2006-05-20 06.56.20.840 1.7
2006-05-20 07.03.49.630 1.9
2006-05-20 07.05.56.190 4.0
2006-05-20 07.08.15.030 2.3
2006-05-20 07.12.31.780 1.7
2006-05-20 07.17.23.510 1.8
2006-05-20 07.19.29.190 2.0
2006-05-20 07.30.41.920 2.8
2006-05-20 07.32.32.860 1.2
2006-05-20 07.35.54.070 1.7
2006-05-20 07.39.48.950 2.0
2006-05-20 09.15.05.810 1.7
2006-05-20 13.04.04.630 2.7
2006-05-20 13.14.30.400 1.6
2008-01-07 17.45.12.910 2.7
2008-01-07 17.46.11.350 1.4
2008-01-07 17.47.29.560 2.1
2008-01-07 18.13.20.590 2.6
2008-01-07 18.30.23.820 2.4
2008-01-07 18.32.10.920 2.2
2008-01-07 18.36.53.900 2.3
2008-01-07 18.39.41.950 2.2
2008-01-07 18.41.54.480 2.2
2008-01-07 22.35.51.490 2.1
2008-01-08 00.42.46.150 2.0
2008-01-08 00.43.13.610 1.5
2008-01-08 21.27.25.360 1.4
2008-12-16 01.48.15.660 2.5
2008-12-16 02.19.25.640 2.3
2008-12-16 02.22.05.990 2.2
2008-12-16 02.29.23.160 2.6
2008-12-16 02.30.14.630 4.0
2008-12-16 02.30.58.370 3.3
2008-12-16 02.32.01.300 2.7
2008-12-16 02.33.28.480 3.2
2008-12-16 02.38.16.880 2.5
2008-12-16 02.43.59.730 1.9
2008-12-16 02.45.22.530 2.5
2008-12-16 03.33.20.650 2.1
2008-12-16 03.50.47.820 2.0
2008-12-16 03.53.05.000 2.2
2008-12-16 04.34.49.800 2.5
2008-12-16 04.47.40.830 2.3
2008-12-16 04.49.45.460 1.9
2008-12-16 05.03.03.190 1.9
2008-12-16 05.29.15.320 2.4
2008-12-16 06.36.49.670 2.1
2008-12-16 08.23.45.970 2.5
2008-12-16 08.29.18.610 3.0
2008-12-16 08.47.22.210 2.1
2008-12-16 09.27.08.190 2.4
2008-12-16 09.38.41.270 2.3
2009-01-08 15.38.45.530 1.8
2009-01-08 15.39.49.500 2.8
2009-01-08 15.40.42.700 2.3
2009-01-08 15.42.46.570 3.1
2009-01-08 15.45.32.490 1.9
2009-01-08 15.47.05.500 1.7
2009-01-08 15.47.28.710 1.9
2009-01-08 15.48.10.510 2.5

There are date and magnitude.

Why no plot all data? What is the error? I think in gmt set i don’t put very well same of these command.

Try adding -i0,2 -fi0T,2d to the end of your gmt plot command to set that the 1st and 3rd columns should be used for plotting and the first column is absolute time.

Not sure, but may be necessary to insert a T between the date and time (as in clock).

Thanks @maxrjones i plot all data.
@Andreas it is possible but to do this for small dataset it ok…but i have a large dataset so it is very difficult.

Now i have another thingh to do…in axes x there is only the years why? I would like years-month-date…it is possible? I try more things.

I recommend reading through this section of the cookbook to learn about the different settings that control the appearance of time axes: https://docs.generic-mapping-tools.org/dev/cookbook/options.html#cartesian-time-axes

thanks very much.

Play with the parameter --FORMAT_DATE_OUT, e.g. --FORMAT_DATE_OUT=dd.mm.yyyy .

Also, which OS are you using? If you’re on Linux, just use awk to format your datatable.

To insert a T (ref. my post above), just do:

awk '{print $1 "T" $2,$3}' data.txt
2006-01-08T13.23.43.720 2.0
2006-01-08T13.26.27.290 2.8
2006-01-08T13.27.17.850 2.2
2006-01-08T13.28.03.070 2.7
2006-01-08T13.32.02.560 2.2
[...]

Knowing just a little bit of those basic tools will get you a long way.

Best to explain to the purveyor of the data that storing a single coordinate across two data columns is not a smart decision. One would not store distance in two columns, such as integer kilometers and then a second column for fractional km. It just adds extra aggravation and need for awk and similar tools. There is an ISO standard for time date strings so no excuse for people to create such messes.

1 Like

Yes i did and i received this error
C:\Users\Anna>gmt set FORMAT_DATA_OUT=yyyy.mm.dd
gmtset [ERROR]: Unrecognized keyword FORMAT_DATA_OUT.
gmtset [ERROR]: 1 GMT Defaults conversion errors from command options

I use windows 10. and visual studio code.

I don’t remember ever seeing an earthquake data catalog that had the date and time in an ISO standard format. Many even have the year, month, day, hour, minute, and seconds in six separate columns. I think it is a remnant of Fortran code, which you may remember is extremely poor at parsing strings of characters.

Per documentation the keyword is FORMAT_DATE_OUT.

Yes, there is history here and decisions not to make changes. I think the Harvard/Ekstrom catalog when queried gives ISO time stamps. Then, I am not a seismologist so not that familiar with what IRIS does, for instance. But it is a single coordinate (point in time) and the decision to store it across 2-n columns is indeed rooted in punchcards…

thanks so much for your answers!