label font for colorbar is smaller than FONT_LABEL?

Open
#8,796 12 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
c

Research direction

Start by running the provided GMT script and comparing the colorbar label with the matching gmt text output. Trace how colorbar applies FONT_LABEL and determine whether the rendered sizes should match; done when the behavior is corrected or its intentional difference is clearly established and tested.

Written by the indexing model from the issue text.

Description

question

I am using GMT 6.5.0 so apologies if this is already fixed (or not a bug).

Description of the problem

When setting the font size for my colorbar label with --FONT_LABEL it renders as smaller than if I used the same font with pstext. Is this intended? I can change the size with --FONT_LABEL, it's just that the actual sizes don't seem to match up.

(From testing it seems that setting axis labels on the main plot, e.g. in psbasemap -Bx+l, results in the same size text as pstext gives me, so it is colorbar that is producing a smaller font than specified with FONT_LABEL.)

Full script that generated the error

gmt begin labeltest png
gmt grdimage @earth_relief_01m -R-10/10/48/60 -Coleron -JM10c -BneSW -Bxaf -Byaf
gmt colorbar -Bxa1000+l"Elevation (m)" --FONT_LABEL=20p,Helvetica
echo "Elevation (m)" |  gmt text -F+f20p,Helvetica+cBC -D0/-3c -N
gmt end

Actual outcome

Image

Expected outcome

I would expect the two lines of text saying "Elevation (m)" to be the same size, since they are both set to 20p,Helvetica as far as I can tell.

System information

  • Operating system: Debian GNU/Linux 12 (bookworm)
  • GMT version (gmt --version): 6.5.0
Dominant language
C
Stars
997
Forks
420
Avg merge
13h 27m
Merged PRs (30d)
47

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenericMappingTools/gmt

All issues in GenericMappingTools/gmt

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.