# Seriestime GMT\_part2

**URL:** <https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571>\
**Category:** Q&A\
**Created:** [January 30, 2022, 4:00pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571 "2022-01-30T16:00:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [January 30, 2022, 4:00pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/1 "2022-01-30T16:00:56Z")

</div>

hello this is my code

```
gmt begin series_times pdf,png

gmt set GMT_THEME cookbook

gmt set FONT_ANNOT_PRIMARY +9p

gmt set FORMAT_DATE_MAP=-o    

gmt set GMT_LANGUAGE IT

gmt set IO_COL_SEPARATOR=tab

gmt info C:\programs\Instance_Sicilia_A.csv

gmt plot C:\programs\Instance_Sicilia_A.csv -i3,4 -Sc0.15c -Gred -R2005-01-01T/2020-01-30T/0.0/6.5 -JX10i -Bxafg+l"Time" -Byafg+l"Magnitude" -fi3T,2d

gmt end show

```

i want understand why my points no its align for time label.

this is what i received with this code

 ![Screenshot (747)](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/b/bfdc3c0bff402169829ad092f848de5f1fc9910b.png)

and than this is want i want…

 ![series_times](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/d/d708dcba83956ea61fdd9ee34ab0fa60fb6fcadb.png)

in .csv i have  
35911 13.3917 38.5727 2012-07-11T10:07:40.96Z 2.9 11.0  
long lat time mag depth

---

<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:** [January 30, 2022, 10:11pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/2 "2022-01-30T22:11:49Z")

</div>

The **-f** option looks suspicious, why is there a 2d there? You do not have any columns in cm or inches as far as I can tell.

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [January 31, 2022, 9:35am UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/3 "2022-01-31T09:35:52Z")

</div>

I increment my code with this  
gmt set FONT\_ANNOT\_PRIMARY +9p

GMT set FORMAT\_DATA\_IN 2005-01-01T

gmt set FORMAT\_DATA\_OUT 2005-01-01T

gmt set FORMAT\_DATE\_MAP=-yyyy

gmt set TIME\_EPOCH 2005-01-01T

and in gmt plot i remove +2d…but i dont receive my result…

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [January 31, 2022, 2:19pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/4 "2022-01-31T14:19:46Z")

</div>

What’s the problem exactly ?

The only obvious difference between your plot and “this is what I want” is the y-axis limits.

> -R2005-12-01T/2021-01-31T/1/4.1

no?  
(don’t hesitate to use tools such as [deepl](https://www.deepl.com/translator) to better explain and translate what you really want)

Best,  
G.

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [January 31, 2022, 2:53pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/5 "2022-01-31T14:53:40Z")

</div>

“What I really want” is an example to make you understand.

The code is the reality of my plot.

I want the points to be perfectly aligned as in the plot example.

I honestly don’t understand why they don’t line up…non-aligned is meaningless.

Surely there is something wrong with the code, but I don’t understand what.  
I have quoted the first line of the .csv file so you can see how the columns are combined.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [January 31, 2022, 3:10pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/6 "2022-01-31T15:10:27Z")

</div>

Do you mean vertically aligned ?

Your data have time records down to 0.01 seconds (eg. 2012-07-11T10:07:40.96)

What GMT is doing is placing this time coordinate as precisely as resolution allows.

So a point in July 7th and a point the very next day (July 8th) won’t be aligned.

If I understood correctly and you need the points to be aligned, I suggest

- using a different module (such as histogram)  
-or-
- specify the entry to be rounded (everything at July 1st for anything in July for example)

Is it sensible or am I off track ?

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [January 31, 2022, 3:17pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/7 "2022-01-31T15:17:38Z")

</div>

aligned as in the second screenshot you see.

In this way I will have a time series that allows me to see in that year what earthquakes, and therefore what magnitude, I had.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [January 31, 2022, 3:32pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/8 "2022-01-31T15:32:16Z")

</div>

Can you try these lines ?

```auto
gmt begin series_times png

gmt math C:\programs\Instance_Sicilia_A.csv --FORMAT_CLOCK_OUT=- --FORMAT_DATE_OUT=yyyy-mm = test.txt
gmt plot test.txt -i3,4 -Sc0.15c -Gred -R2005-01-01T/2020-01-30T/0.0/6.5 -JX10i -Bxafg+l"Time" -Byafg+l"Magnitude"

gmt end show

```

First one converts your csv file into text file with rounded timestamps,  
Second line is your plot

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [January 31, 2022, 3:45pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/9 "2022-01-31T15:45:32Z")

</div>

![Screenshot (749)](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/d/d3f80f01261532043c455ad8ffa453ed33897139.png) Uploading: Screenshot (749).png…

I obtain this.  
It is the same

I dont change anythings

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [January 31, 2022, 3:59pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/10 "2022-01-31T15:59:16Z")

</div>

Well, I have “aligned” them per month. If you want even coarser resolution (aligned per year), just remove `mm` in `--FORMAT_DATE_OUT=yyyy-mm`

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [January 31, 2022, 4:02pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/11 "2022-01-31T16:02:29Z")

</div>

![Screenshot (750)](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/b/b25a4bb9df474786906f062ef98432d2e8801c2c.png)

YEAH!!!  
It’s fantastic.

do you know how I can add the years 2005 or 2007, which don’t appear yet? there seems to be an interval of 2…

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [January 31, 2022, 4:07pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/12 "2022-01-31T16:07:08Z")

</div>

> [@PlanetGus](#):
>
> ` -Bxafg+l"Time"`

`-Bxa1Yf1Yg1Y+l"Time"` instead of automatic `-Bxafg` maybe ?

Like I said last time, _a_ controls annotations … without further instruction GMT defines the interval automatically, else it uses your steps (here `1y` = annotation every year)  
_f_ is for ticks (frame) and _g_ for grid-line

You should play with the tutorial : [https://docs.generic-mapping-tools.org/dev/tutorial/session-1.html#logarithmic-projection](https://docs.generic-mapping-tools.org/dev/tutorial/session-1.html#logarithmic-projection)

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [January 31, 2022, 4:17pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/13 "2022-01-31T16:17:24Z")

</div>

> [@PlanetGus](#):
>
> -Bxa1Yf1Yg1Y+l"Time"

Thank you very much.  
Yes I know, I should play it more…only then I fail that I try several times…and I ask you to help me out of desperation. I’m new to this world… I’m getting the hang of it little by little.  
Thank you for your prompt and sincere help.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [January 31, 2022, 4:25pm UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/14 "2022-01-31T16:25:54Z")

</div>

Same at the beginning of my PhD too 🙂

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [February 2, 2022, 8:48am UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/15 "2022-02-02T08:48:34Z")

</div>

Hi, I wanted to ask you for confirmation…about this line of code which is similar to everything you have seen above.

-Bx15ua1Yfg+l “Time”

in this case, am I telling it to select my data every 15 days making the axis stay with a year to year interval?

Because if I change and put everything with 15u it’s a mess.

I need to have a bigger window, 1 or 2 weeks..for the time series.

As in this example…

 ![4-Figure2-1](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/c/c634a4f8ef84f99ea8db21315155a91d3812e284.png)

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [February 2, 2022, 11:03am UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/16 "2022-02-02T11:03:42Z")

</div>

You want to “hide” your data ? Or do you want take an average value per 2 weeks window ?

The order for `-B` parameters is [letter]value. In the code you shared the “15u” is doing nothing … I think.

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [February 2, 2022, 11:21am UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/17 "2022-02-02T11:21:12Z")

</div>

No I want to represent all the data…the time window must be enlarged.

Instead of having plotted are years… I need a window of 2 weeks and not every year.

The same in the screenshot.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [February 2, 2022, 11:36am UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/18 "2022-02-02T11:36:07Z")

</div>

You mean the grid lines ?

`-Ba1Yfg2u` (or U?)

This will annotate the calendar year (2020, 2021 …)  
Use automatic ticks  
Put gridlines every 2 weeks.

If you just want to “zoom in”  
It’s `-R` that you need to change (`-R2000-01-01T/2000-02-01T` would plot only January 2000)

---

<div class="post-metadata">

**Author:** ![annafiglioli](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@annafiglioli](https://forum.generic-mapping-tools.org/u/annafiglioli)\
**Post date:** [February 2, 2022, 11:51am UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/19 "2022-02-02T11:51:16Z")

</div>

![Screenshot (751)](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/c/c5977d3ef92a7d4541cc5b4cd24dd6ed531870f6.png) Uploading: Screenshot (751).png…

this is the result.  
it very terrible…I had already done this option, but I was not enthusiastic about it because it shows almost everything grey.

isn’t there a way to do what I wrote but not make it like this? But like in the screenshot?

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [February 2, 2022, 11:57am UTC](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571/20 "2022-02-02T11:57:34Z")

</div>

The screenshot uses gridlines every years. There’s nothing apparent about a 2 weeks period.

It’d be simply `-Ba1Yf1Yg1Y`, and you can change the line style with `--MAP_GRID_PEN_PRIMARY=thin,lightgray,dotted` for example

[Next page](https://forum.generic-mapping-tools.org/t/seriestime-gmt-part2/2571.md?page=2)
