Psscale (colorbar) and its label font size

Dear community,

I’ve been using GMT for several years and recently updated to GMT 6.6.0. In this version I noticed that the font size of the color bar labels change depending on the color bar length. For example: The shorter the length, the smaller the fonts. Is it possible to keep the label font size the same, regardless of the length/width of the color bar? This used to be the behavior in earlier versions (for example, I migrated from GMT 6.4.0). Also, setting FONT_ANNOT_PRIMARY and FONT_LABEL in gmtset doesn’t help solving the issue.

To replicate this problem, we can use example 15 of the GMT tutorial (link here). In my case, I want to have control on the length of a vertical color bar, so I added the option +w in -D. The only change with respect to that example is using something like -DJMR+w5.0c in colorbar and play around with the number. The color bar length changes as expected, but the font sizes also do (which I don’t want).

I installed GMT in the same way I always have, compiled from sources on Linux.

I would really appreciate any help and suggestions.

Hi @carlosfherrera,

The behaviour you describe is the expected behaviour for GMT >= 6.5.0.
Please see similar posts for details:

Currently, users need to redo the scaling manually following the scaling factor \sqrt{colorbar\_width/15}, please see the note in the PyGMT documentation at pygmt.Figure.colorbar — PyGMT.

Dear @yvonnefroehlich,

Thanks for pointing out to all those discussions! It’s good to know that this was an intended behavior and not a bug. I also found a Python script that you created to manually edit the scaling (GitHub link). In my case, I found a simple solution in my shell script by simply adding the option --FONT=${number}p to gmt psscale, where number is whatever value that I want to assign to the color bar label font size.

Also, as of today I noticed in the documentation that a new option -H may be implemented in version 6.7.0 (currently in development), which can set whether color bar annotation scaling is applied or not.

The -H option was implemented a while ago. DEV docs show

-H

    From GMT 6.5 on, colorbar annotation fonts are auto-scaled. Use this option to prevent that effect and let user set fonts as they wish.

Hi @Joaquim,

Then maybe I’m missing something. Currently, the docs for version 6.6.0 (the version I have installed) don’t have that option included (psscale docs in GMT 6.6.0). Also, if I add -H as an option in my script, I get the following message on the console:
psscale [ERROR]: Unrecognized option -H

Well, I said DEV docs, not 6.6.0 docs. -H was implemented but in the developing (master) version. It will show up in 6.7.

I mentioned this because you said above I noticed in the documentation that a new option -H may be implemented in version 6.7.0
It’s not a maybe. It was in fact.