From e660a9f0bef234b679bd96a33eb17ca824f4f503 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 4 Sep 2026 15:02:01 +0800 Subject: [PATCH 1/4] Figure.histogram: Migrate the parameters pen/fill to the new alias system --- pygmt/src/histogram.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 67d9b6d1009..a6ec0a830ee 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -23,13 +23,11 @@ A="horizontal", D="annotate", F="center", - G="fill", L="extreme", N="distribution", Q="cumulative", S="stairs", T="series", - W="pen", Z="histtype", b="binary", d="nodata", @@ -45,6 +43,8 @@ def histogram( bar_width: float | str | None = None, bar_offset: float | str | None = None, cmap: str | bool = False, + pen: str | None = None, + fill: str | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, frame: Frame | Axis | Literal["none"] | str | Sequence[str] | bool = False, @@ -65,9 +65,11 @@ def histogram( - B = frame - C = cmap - E = bar_width, bar_offset + - G = fill - J = projection - R = region - V = verbose + - W = pen - c = panel - i = incols - p = perspective @@ -79,9 +81,11 @@ def histogram( Pass in either a file name to an ASCII data table, a Python list, a 2-D $table_classes. $cmap - fill : str + pen + Draw bar outline (or stair-case curve) using the specified pen thickness + [Default is no outline]. + fill Set color or pattern for filling bars [Default is no fill]. - $pen annotate : bool or str [**+b**][**+f**\ *font*][**+o**\ *off*][**+r**]. Annotate each bar with the count it represents. Append any of the @@ -169,6 +173,8 @@ def histogram( Alias(bar_width, name="bar_width"), Alias(bar_offset, name="bar_offset", prefix="+o"), ], + G=Alias(fill, name="fill"), + W=Alias(pen, name="pen"), ).add_common( B=frame, J=projection, From 78301835be28609cfcce1bc2494416a493788dd0 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 4 Sep 2026 15:18:24 +0800 Subject: [PATCH 2/4] Also fix docstrings for bar_width/bar_offset --- pygmt/src/histogram.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index a6ec0a830ee..ee7aa8cdf1f 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -64,7 +64,7 @@ def histogram( $aliases - B = frame - C = cmap - - E = bar_width, bar_offset + - E = bar_width, **+o**: bar_offset - G = fill - J = projection - R = region @@ -99,8 +99,8 @@ def histogram( either an alternative width in data units, or the user may append a :ref:`dimension unit ` for a fixed dimension instead. bar_offset - Shift all bars along the axis by *offset*. It may be given in data units - of plot dimension units by appending the relevant unit. + Shift all bars along the axis by *offset*. It may be given in data units of plot + dimension units by appending the relevant unit. center : bool Center bin on each value. [Default is left edge]. distribution : bool, float, or str From 7b68ceab07165092e828a6fe65a9d5c48c04d65a Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 4 Sep 2026 17:16:29 +0800 Subject: [PATCH 3/4] Apply suggestion from @yvonnefroehlich MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com> --- pygmt/src/histogram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index ee7aa8cdf1f..61d984ae83c 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -99,7 +99,7 @@ def histogram( either an alternative width in data units, or the user may append a :ref:`dimension unit ` for a fixed dimension instead. bar_offset - Shift all bars along the axis by *offset*. It may be given in data units of plot + Shift all bars along the axis by a constant value. It may be given in data units of plot dimension units by appending the relevant unit. center : bool Center bin on each value. [Default is left edge]. From f0316fbc9a700cdee6605ff7862388af0807bd2d Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 4 Sep 2026 17:23:05 +0800 Subject: [PATCH 4/4] Fix line length --- pygmt/src/histogram.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 61d984ae83c..2141eab7ffd 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -99,8 +99,8 @@ def histogram( either an alternative width in data units, or the user may append a :ref:`dimension unit ` for a fixed dimension instead. bar_offset - Shift all bars along the axis by a constant value. It may be given in data units of plot - dimension units by appending the relevant unit. + Shift all bars along the axis by a constant value. It may be given in data units + of plot dimension units by appending the relevant unit. center : bool Center bin on each value. [Default is left edge]. distribution : bool, float, or str