GenericMappingTools / GenericMappingTools/gmt

`colorbar [ERROR]: Time steps in seconds must be <= 60` if plotting done with a time X axis and the manually assigned colorbar (X) interval is > 60

Open
#8,953 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

`colorbar` seems to "inherit" X axis time units and does not allow tick interval greater than 60. This happens if plotting before colorbar is done with a time X axis. Please see the minimal failing code below.

The error occured only if the `colorbar` intervals are specified manually, automatic assignment of `colorbar` interval does not produce an error.

The expected behaviour is of course that the plot X axis settings has no effect on the `colorbar` interval settings so any manually assigned interval value works.

the minimal failing code:
```
gmt colorbar -R2017-01-01T/2025-01-01T/0/1 -JX10c/5c -Bxa500 -Cturbo -png colorbar
```

fails with the following error message:
```
colorbar [ERROR]: Time steps in seconds must be <= 60
colorbar [ERROR]: Option -B parsing failure. Correct syntax:

-B Specify both (1) basemap frame settings and (2) axes parameters.
Frame settings are modified via an optional single invocation of
-B[][+b][+g][+i[]][+n][+o/][+s]⏎
…[+t][+w[<pen>]][+x<fill>][+y<fill>][+z<fill>]
Axes parameters are specified via one or more invocations of -B[p|s][x|y|⏎
…z]<intervals>[+a<angle>|n|p][+e[l|u]][+f][+l|L<label>][+p<prefix>][+s|⏎
…S<secondary_label>][+u<unit>
<intervals> is composed of concatenated [<type>]<stride>[l|p] sub-
strings. See basemap documentation for more details and examples of all
settings.
colorbar [ERROR]: Offending option -Bxa500
```

if the interval is less than 60, the colorbar is plotted successfully:
```
gmt colorbar -R2017-01-01T/2025-01-01T/0/1 -JX10c/5c -Bxa50 -Cturbo -png colorbar
```
colorbar.png:

<img width="956" height="86" alt="Image" src="https://github.com/user-attachments/assets/c89303cb-e63b-4fba-849d-7adb3ce5e06d" />

the failing code above is expected to produce exactly the same result

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.