From ecd9ff807bac29a0331afaa8223a80205449342c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 12 Dec 2025 18:59:43 +0100 Subject: [PATCH 1/2] Deprecate equalsize to equal_size --- pygmt/src/colorbar.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 3e7efb32984..6c390c8b70d 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -7,14 +7,15 @@ from pygmt.alias import Alias, AliasSystem from pygmt.clib import Session -from pygmt.helpers import build_arg_list, fmt_docstring, use_alias +from pygmt.helpers import build_arg_list, deprecate_parameter, fmt_docstring, use_alias from pygmt.params import Box __doctest_skip__ = ["colorbar"] @fmt_docstring -@use_alias(C="cmap", D="position", L="equalsize", Z="zfile") +@deprecate_parameter("equalsize", "equal_size", "v0.18.0", remove_version="v0.20.0") +@use_alias(C="cmap", D="position", L="equal_size", Z="zfile") def colorbar( # noqa: PLR0913 self, truncate: Sequence[float] | None = None, @@ -118,7 +119,7 @@ def colorbar( # noqa: PLR0913 from *-max_intens* to *+max_intens*. - Passing a sequence of two numerical values (*low*, *high*) sets the intensity range from *low* to *high* to specify an asymmetric range. - equalsize : float or str + equal_size : float or str [**i**]\ [*gap*]. Equal-sized color rectangles. By default, the rectangles are scaled according to the z-range in the CPT (see also ``zfile``). If *gap* is @@ -134,7 +135,7 @@ def colorbar( # noqa: PLR0913 zfile : str File with colorbar-width per color entry. By default, the width of the entry is scaled to the color range, i.e., z = 0-100 gives twice the - width as z = 100-150 (see also ``equalsize``). **Note**: The widths + width as z = 100-150 (see also ``equal_size``). **Note**: The widths may be in plot distance units or given as relative fractions and will be automatically scaled so that the sum of the widths equals the requested colorbar length. From 3c715393e5ff231563c287676dbf32e884d36aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 12 Dec 2025 18:59:58 +0100 Subject: [PATCH 2/2] Update gallery example --- examples/gallery/embellishments/colorbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/embellishments/colorbar.py b/examples/gallery/embellishments/colorbar.py index c97f8b42838..f00d9ae7530 100644 --- a/examples/gallery/embellishments/colorbar.py +++ b/examples/gallery/embellishments/colorbar.py @@ -82,7 +82,7 @@ position="jBL+o0.5c/0.8c+h", box=True, # Divide colorbar into equal-sized rectangles - equalsize=0.5, + equal_size=0.5, ) fig.show()