Skip to content

Commit 35f06da

Browse files
Figure.colorbar: Add note regarding automatic fontsize scaling (#4126)
Mention how for GMT >=6.5.0, fontsizes of the colorbar x-label, x-annotations, and y-label are scaled based on the width of the colorbar following sqrt(colorbar_width / 15), and how to adjust the fontsizes by setting FONT_ANNOT_PRIMARY, FONT_ANNOT_SECONDARY, or FONT_LABEL. --------- Co-authored-by: Wei Ji <[email protected]>
1 parent 488e0bd commit 35f06da

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pygmt/src/colorbar.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ def colorbar(
4949
linear scale, all be equal size, or by providing a file with individual
5050
tile widths.
5151
52+
.. note::
53+
For GMT >=6.5.0, the fontsizes of the colorbar x-label, x-annotations,
54+
and y-label are scaled based on the width of the colorbar following
55+
:math:`\sqrt{{colorbar\_width / 15}}`). To set a desired fontsize via the
56+
GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`,
57+
:gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly
58+
:gmt-term:`FONT`) users have to divide the desired fontsize by the value
59+
calculated with the formula given above before passing it to the default
60+
parameters. To only affect fontsizes related to the colorbar, the
61+
defaults can be changed locally only using ``with pygmt.config(...):``.
62+
5263
Full GMT docs at :gmt-docs:`colorbar.html`.
5364
5465
{aliases}

0 commit comments

Comments
 (0)