From 09750d01d5b9828e823e7b39597b6d02317d4322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Thu, 30 Jul 2026 17:21:36 +0200 Subject: [PATCH 1/7] Suggest an alias for '-H' of colorbar --- pygmt/src/colorbar.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 9d264e42787..b356f167016 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -272,6 +272,7 @@ def colorbar( scale: float | None = None, monochrome: bool = False, dpi: int | None = None, + no_font_scaling: bool = False, projection: str | None = None, region: Sequence[float | str] | str | None = None, frame: Frame | Axis | Literal["none"] | str | Sequence[str] | bool = False, @@ -296,13 +297,15 @@ def colorbar( .. note:: For GMT >=6.5.0, the fontsizes of the colorbar x-label, x-annotations, and y-label are scaled based on the width of the colorbar following - :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize via the + :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize use the GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly - :gmt-term:`FONT`) users have to divide the desired fontsize by the value - calculated with the formula given above before passing it to the default - parameters. To only affect fontsizes related to the colorbar, the - defaults can be changed locally only using ``with pygmt.config(...):``. + :gmt-term:`FONT`) + For GMT >=6.7.0, users should use ``no_font_scaling = True`` to turn of + the automatic fontsize scaling. + For GMT 6.5.0 - 6.6.0, users have to divide the desired fontsize by the + value calculated with the formula given above before passing it to the + default parameters. Full GMT docs at :gmt-docs:`colorbar.html`. @@ -310,6 +313,7 @@ def colorbar( - C = cmap - F = box - G = truncate + - H = no_font_scaling - I = shading - J = projection - M = monochrome @@ -463,6 +467,10 @@ def colorbar( If not specified, GMT uses its default encoding behavior, and the default dpi is 600 if the colorbar is drawn as image. + no_font_scaling + For GMT >=6.5.0, the fontsizes used for the colorbar are scaled automaticly + based on the length of the colorbar. For GMT >= 6.7.0, use this parameter to + turn of the this automatic fontsize scaling. $projection $region $verbose @@ -518,6 +526,7 @@ def colorbar( ), F=Alias(box, name="box"), G=Alias(truncate, name="truncate", sep="/", size=2), + H=Alias(no_font_scaling, name="no_font_scaling"), I=Alias(shading, name="shading", sep="/", size=2), M=Alias(monochrome, name="monochrome"), N=_alias_option_N(dpi=dpi), From d1e1b14dabc5dfe4bc307ea2071f76ba89f62d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Sun, 23 Aug 2026 14:14:20 +0200 Subject: [PATCH 2/7] Fix typo Co-authored-by: Dongdong Tian --- pygmt/src/colorbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index b356f167016..ef867b1eaec 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -301,7 +301,7 @@ def colorbar( GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly :gmt-term:`FONT`) - For GMT >=6.7.0, users should use ``no_font_scaling = True`` to turn of + For GMT >=6.7.0, users should use ``no_font_scaling = True`` to turn off the automatic fontsize scaling. For GMT 6.5.0 - 6.6.0, users have to divide the desired fontsize by the value calculated with the formula given above before passing it to the From a9ab2b75bc40c2e78e105f2a5ba4e3bf856c8b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:23:14 +0200 Subject: [PATCH 3/7] Improve formulation Co-authored-by: Dongdong Tian --- pygmt/src/colorbar.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index ef867b1eaec..b6f38c75cbb 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -468,9 +468,9 @@ def colorbar( If not specified, GMT uses its default encoding behavior, and the default dpi is 600 if the colorbar is drawn as image. no_font_scaling - For GMT >=6.5.0, the fontsizes used for the colorbar are scaled automaticly - based on the length of the colorbar. For GMT >= 6.7.0, use this parameter to - turn of the this automatic fontsize scaling. + By default, the font sizes used for the colorbar are scaled automatically + based on the length of the colorbar. Set this parameter to ``True`` to + turn off the automatic scaling [Requires GMT>=6.7.0]. $projection $region $verbose From 7b85abfa15878248b9f9f140e42d5e5fadf67bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:23:47 +0200 Subject: [PATCH 4/7] Improve formulation Co-authored-by: Dongdong Tian --- pygmt/src/colorbar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index b6f38c75cbb..5ee3387ece5 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -295,8 +295,8 @@ def colorbar( tile widths. .. note:: - For GMT >=6.5.0, the fontsizes of the colorbar x-label, x-annotations, - and y-label are scaled based on the width of the colorbar following + By default, the fontsizes of the colorbar annotations, label, and unit + are scaled based on the width of the colorbar following :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize use the GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly From 45390bf79a00701548bef85987cc50bbdc0abafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 24 Aug 2026 12:30:32 +0200 Subject: [PATCH 5/7] Fix style --- pygmt/src/colorbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 5ee3387ece5..b22e8bc6158 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -469,7 +469,7 @@ def colorbar( is 600 if the colorbar is drawn as image. no_font_scaling By default, the font sizes used for the colorbar are scaled automatically - based on the length of the colorbar. Set this parameter to ``True`` to + based on the length of the colorbar. Set this parameter to ``True`` to turn off the automatic scaling [Requires GMT>=6.7.0]. $projection $region From 924a7c01a63b94a19d6135e0d6ccc24457139d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 17 Nov 2026 13:31:39 +0100 Subject: [PATCH 6/7] Move note to no_font_scaling parameter --- pygmt/src/colorbar.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index a269940b7a0..a5965f8a4be 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -294,19 +294,6 @@ def colorbar( linear scale, all be equal size, or by providing a file with individual tile widths. - .. note:: - By default, the fontsizes of the colorbar annotations, label, and unit - are scaled based on the width of the colorbar following - :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize use the - GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, - :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly - :gmt-term:`FONT`) - For GMT >=6.7.0, users should use ``no_font_scaling = True`` to turn off - the automatic fontsize scaling. - For GMT 6.5.0 - 6.6.0, users have to divide the desired fontsize by the - value calculated with the formula given above before passing it to the - default parameters. - Full GMT docs at :gmt-docs:`colorbar.html`. $aliases @@ -471,6 +458,20 @@ def colorbar( By default, the font sizes used for the colorbar are scaled automatically based on the length of the colorbar. Set this parameter to ``True`` to turn off the automatic scaling [Requires GMT>=6.7.0]. + + .. note:: + By default, the fontsizes of the colorbar annotations, label, and unit + are scaled based on the width of the colorbar following + :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize use the + GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, + :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly + :gmt-term:`FONT`) + For GMT >=6.7.0, users should use ``no_font_scaling = True`` to turn off + the automatic fontsize scaling. + For GMT 6.5.0 - 6.6.0, users have to divide the desired fontsize by the + value calculated with the formula given above before passing it to the + default parameters. + $projection $region $verbose From 20fbc5d5e2cb2a656c16d2d790faa77339456064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 17 Nov 2026 13:38:56 +0100 Subject: [PATCH 7/7] Adjust line length and forumlation of note --- pygmt/src/colorbar.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index a5965f8a4be..6d70a632a6e 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -460,17 +460,15 @@ def colorbar( turn off the automatic scaling [Requires GMT>=6.7.0]. .. note:: - By default, the fontsizes of the colorbar annotations, label, and unit - are scaled based on the width of the colorbar following - :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize use the - GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, + By default, the fontsizes of the colorbar annotations, label, and unit are + scaled based on the width of the colorbar following + :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize use the GMT + default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly - :gmt-term:`FONT`) - For GMT >=6.7.0, users should use ``no_font_scaling = True`` to turn off - the automatic fontsize scaling. - For GMT 6.5.0 - 6.6.0, users have to divide the desired fontsize by the - value calculated with the formula given above before passing it to the - default parameters. + :gmt-term:`FONT`). For GMT >=6.7.0, users can use ``no_font_scaling = True`` + to turn off the automatic fontsize scaling. For GMT 6.5.0 - 6.6.0, users + have to divide the desired fontsize by the value calculated with the formula + given above before passing it to the default parameters. $projection $region