From 130a569e264ab9c460817084c8371a329f9ab8fc Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 9 Feb 2023 20:25:13 +0100 Subject: [PATCH 1/8] Sort aliases list alphabetically --- 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 c85dcb0ce0f..138c653893b 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -8,16 +8,16 @@ @fmt_docstring @use_alias( - R="region", - J="projection", B="frame", C="cmap", D="position", F="box", G="truncate", I="shading", - W="scale", + J="projection", + R="region", V="verbose", + W="scale", c="panel", p="perspective", t="transparency", From 95fa2a76920ab60f6a9b55374d0d30d0e82f2fab Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 9 Feb 2023 20:36:51 +0100 Subject: [PATCH 2/8] Add aliases for 'L', 'Z' --- pygmt/src/colorbar.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 138c653893b..7eff78cfff7 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -15,9 +15,11 @@ G="truncate", I="shading", J="projection", + L="equalsize", R="region", V="verbose", W="scale", + Z="zfile", c="panel", p="perspective", t="transparency", From 88399be134d6a7368b6582ff0fc549230bead732 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 9 Feb 2023 20:40:08 +0100 Subject: [PATCH 3/8] Add docstring for 'equalsize' parameter --- pygmt/src/colorbar.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 7eff78cfff7..117ecc3b993 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -99,6 +99,15 @@ def colorbar(self, **kwargs): used. Alternatively, set ``shading=[low, high]`` to specify an asymmetric intensity range from *low* to *high*. [Default is no illumination]. + equalsize : int or float or str + [**i**]\ [*gap*]. + Gives equal-sized color rectangles. Default scales rectangles according + to the z-range in the CPT (see also ``zfile``). If *gap* is appended + and the CPT is discrete the annotations are centered on the rectangles, + using the lower boundary z-value for the annotation. If **i** is + prepended the interval range is annotated instead. If ``shading`` is + used then each rectangle will have its constant color modified by the + specified intensity. {verbose} {panel} {perspective} From 5acaaee7d77a8c16171be291affebc12dc630ccb Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 9 Feb 2023 20:56:41 +0100 Subject: [PATCH 4/8] Add docstring for 'zfile' parameter --- pygmt/src/colorbar.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 117ecc3b993..ece831f8da5 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -108,6 +108,13 @@ def colorbar(self, **kwargs): prepended the interval range is annotated instead. If ``shading`` is used then each rectangle will have its constant color modified by the specified intensity. + zfile : str + File with colorbar-width per color entry. By default, width of entry + is scaled to color range, i.e., z = 0-100 gives twice the width as + z = 100-150 (see also ``equalsize``). **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 + bar length. {verbose} {panel} {perspective} From 7d53ec74c42825d64743e35b382a1dc5301d0015 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 9 Feb 2023 21:08:03 +0100 Subject: [PATCH 5/8] Use upper-case for 'Default' --- 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 ece831f8da5..43e05f68b66 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -73,7 +73,7 @@ def colorbar(self, **kwargs): [**+p**\ [*pen*]][**+r**\ [*radius*]][**+s**\ [[*dx*/*dy*/][*shade*]]]. If set to ``True``, draws a rectangular border around the color scale. Alternatively, specify a different pen with **+p**\ *pen*. Add - **+g**\ *fill* to fill the scale panel [default is no fill]. Append + **+g**\ *fill* to fill the scale panel [Default is no fill]. Append **+c**\ *clearance* where *clearance* is either gap, xgap/ygap, or lgap/rgap/bgap/tgap where these items are uniform, separate in x- and y-direction, or individual side spacings between scale and border. @@ -84,7 +84,7 @@ def colorbar(self, **kwargs): this radius by appending another value. Finally, append **+s** to draw an offset background shaded region. Here, *dx/dy* indicates the shift relative to the foreground frame [4p/-4p] and shade sets the fill - style to use for shading [default is gray50]. + style to use for shading [Default is gray50]. truncate : list or str *zlo*/*zhi*. Truncate the incoming CPT so that the lowest and highest z-levels are From bdefccace967849cb1b79cff42ceb130b1552ab4 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 3 Mar 2023 12:40:07 +0100 Subject: [PATCH 6/8] Improve docstrings --- pygmt/src/colorbar.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 43e05f68b66..03ed89626cf 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -101,20 +101,20 @@ def colorbar(self, **kwargs): illumination]. equalsize : int or float or str [**i**]\ [*gap*]. - Gives equal-sized color rectangles. Default scales rectangles according - to the z-range in the CPT (see also ``zfile``). If *gap* is appended - and the CPT is discrete the annotations are centered on the rectangles, - using the lower boundary z-value for the annotation. If **i** is - prepended the interval range is annotated instead. If ``shading`` is - used then each rectangle will have its constant color modified by the - specified intensity. + Equal-sized color rectangles. By default, the rectangles are scalled + according to the z-range in the CPT (see also ``zfile``). If *gap* is + appended and the CPT is discrete each annotation is centered on each + rectangle, using the lower boundary z-value for the annotation. If + **i** is prepended the interval range is annotated instead. If + ``shading`` is used each rectangle will have its constant color + modified by the specified intensity. zfile : str - File with colorbar-width per color entry. By default, width of entry - is scaled to color range, i.e., z = 0-100 gives twice the width as - z = 100-150 (see also ``equalsize``). **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 - bar length. + 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 + 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. {verbose} {panel} {perspective} From d835eb87d6ec09bbacefa027817c42157f96ae4a Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 3 Mar 2023 12:41:56 +0100 Subject: [PATCH 7/8] Revert change default to Default (see follow-up separat PR) --- 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 03ed89626cf..ff82c949387 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -73,7 +73,7 @@ def colorbar(self, **kwargs): [**+p**\ [*pen*]][**+r**\ [*radius*]][**+s**\ [[*dx*/*dy*/][*shade*]]]. If set to ``True``, draws a rectangular border around the color scale. Alternatively, specify a different pen with **+p**\ *pen*. Add - **+g**\ *fill* to fill the scale panel [Default is no fill]. Append + **+g**\ *fill* to fill the scale panel [default is no fill]. Append **+c**\ *clearance* where *clearance* is either gap, xgap/ygap, or lgap/rgap/bgap/tgap where these items are uniform, separate in x- and y-direction, or individual side spacings between scale and border. @@ -84,7 +84,7 @@ def colorbar(self, **kwargs): this radius by appending another value. Finally, append **+s** to draw an offset background shaded region. Here, *dx/dy* indicates the shift relative to the foreground frame [4p/-4p] and shade sets the fill - style to use for shading [Default is gray50]. + style to use for shading [default is gray50]. truncate : list or str *zlo*/*zhi*. Truncate the incoming CPT so that the lowest and highest z-levels are From d80a19cb33c9474d186fc37b636eecb89817d9f0 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 3 Mar 2023 13:17:18 +0100 Subject: [PATCH 8/8] Fix typo (own) --- 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 ff82c949387..3855d88e300 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -101,7 +101,7 @@ def colorbar(self, **kwargs): illumination]. equalsize : int or float or str [**i**]\ [*gap*]. - Equal-sized color rectangles. By default, the rectangles are scalled + Equal-sized color rectangles. By default, the rectangles are scaled according to the z-range in the CPT (see also ``zfile``). If *gap* is appended and the CPT is discrete each annotation is centered on each rectangle, using the lower boundary z-value for the annotation. If