# How to plot time-series data with hourly intervals on x-axis?

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-plot-time-series-data-with-hourly-intervals-on-x-axis/6060>\
**Category:** Q&A\
**Created:** [July 20, 2025, 9:39pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-time-series-data-with-hourly-intervals-on-x-axis/6060 "2025-07-20T21:39:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhonnmarie](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/jhonnmarie/32/4937_2.png) [@jhonnmarie](https://forum.generic-mapping-tools.org/u/jhonnmarie)\
**Post date:** [July 20, 2025, 9:39pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-time-series-data-with-hourly-intervals-on-x-axis/6060/1 "2025-07-20T21:39:03Z")

</div>

Hi all,

I’m working with a time-series dataset that has measurements taken every hour over a 7-day period, and I want to plot it using GMT (I’m using GMT 6.5).

My time column is formatted as YYYY-MM-DDTHH:MM:SS, and I want the x-axis to show ticks every 6 hours, with labels showing just the hour (e.g., 00, 06, 12, 18).

I’ve tried using -Bxa6Hf1H[+](https://calculadoradehoras.io/)l"Time" but it doesn’t format the labels the way I expected. Is there a clean way to customize hourly time labels and control the formatting?

Any advice or examples would be super helpful. Thanks!

Jhonn Marie

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [July 20, 2025, 10:16pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-time-series-data-with-hourly-intervals-on-x-axis/6060/2 "2025-07-20T22:16:07Z")

</div>

Maybe see [(21) Time-series of RedHat stock price — GMT 6.5.0 documentation](https://docs.generic-mapping-tools.org/latest/gallery/ex21.html) and [4. Standardized command line options — GMT 6.5.0 documentation](https://docs.generic-mapping-tools.org/latest/reference/options.html#cartesian-time-axes).

Does `gmt set FORMAT_CLOCK_MAP hh:mm` and `-Bxa6Hf6h` do what you want? (Not tested)

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [July 20, 2025, 10:32pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-time-series-data-with-hourly-intervals-on-x-axis/6060/3 "2025-07-20T22:32:18Z")

</div>

And also de CookBook

> **[4.3.7. Cartesian time axes - 4. Standardized command line options — GMT 6.6.0...](https://docs.generic-mapping-tools.org/latest/reference/options.html#cartesian-time-axes)**
>
> Syntax
