Colorbar and oblique annotation

Hi all,

I would like to annotate a geological time scale cpt ( with oblique annotations from the CPT file (as the labels run into each other in the Cenozoic period).

Selecting no -B option is my base case:

gmt colorbar -CGTS2012_stages.cpt -G0/80 -Dx15/1.0+jBC+w-30/0.4+h+m -V --FONT_ANNOT_PRIMARY=6p --MAP_FRAME_PEN=0.5p,black 

Using -B+a45 (or -Ba+a45) to rotate the annotations (breaks taken from the CPT file) results in a regular spaced x-interval for the annotations (which is not what I want):

gmt colorbar -CGTS2012_stages.cpt -G0/80 -Dx15/1.0+jBC+w-30/0.4+h+m -V --FONT_ANNOT_PRIMARY=6p --MAP_FRAME_PEN=0.5p,black 

Testing -S+n or -S+c in combination with -B+a45 also results in regular x-intervals for the annotation, like -B+a45 (n.b. the manual says that -S is to be used if -B is not called):

gmt colorbar -CGTS2012_stages.cpt -R0/30/0/10 -JX-30/1.4 -G0/80 -Dx15/1.0+jBC+w-30/0.4+h+m -V --FONT_ANNOT_PRIMARY=6p --MAP_FRAME_PEN=0.5p,black -S+n -B+a45 -png s+n_boption

Using the -S+c option alone gives the expected result with custom labels from the CPT plotted:

gmt colorbar -CGTS2012_stages.cpt -R0/30/0/10 -JX-30/1.4 -G0/80 -Dx15/1.0+jBC+w-30/0.4+h+m -V --FONT_ANNOT_PRIMARY=6p --MAP_FRAME_PEN=0.5p,black -S+c -B+a45 -png s+c_boption

So the question is whether there’s a way to get colorbar to use the breaks from the CPT file, yet plot the annotations (or even the custom labels from the CPT) at an angle? Using the -L option for equal sized rectangles is of no use in the case of the geological timescale CPT.


ps - also found that the old -E and -A options from GMT 4 and 5 are happily parsed in GMT6 modern mode without complaints

I think it won’t be too hard to add -S+aangle to the mix. Maybe after an upcoming zoom I have to attend.

Thanks, that would be fantastic @pwessel!

With y-axis too maybe ? :innocent: (

One of these days, @PlanetGus.

1 Like

I got it to work off the tickmarks. Do you imagine that interval labels such as yours would be placed in the middle of the interval so that the left end of the word is centered on the interval? I am not sure how it should work for slanted interval annotations…

@pwessel - excellent!

An option to have the labels in mid interval position would be very useful indeed. Is centering the word possible or just aligning the left end to mid-interval?

Having slanted annotations in mid interval I would not consider too important. If there is an option to center the interval annotation either horizontally or vertically that would cover (at least in my case) the bulk of the use cases. For the others I would then revert to annotate the base of the interval/cpt break using the new -S+a option.

What would be useful though is an option to specify a “shortname” for a longer custom annotation - say in the case of the Stage names to have something like

5.333 255/255/179  7.246 255/255/179 ; "The stage known as Messinian";  TSKAM
7.246 255/255/102  11.621 255/255/102 ; Tortonian; Tor
11.621 255/255/89 13.821 255/255/89 ; Serravallian; Srv

where the last column would be a short name for a longer annotation.