Skip to content

Commit 3921c0d

Browse files
seismanmichaelgrundyvonnefroehlich
authored
Figure.colorbar: Migrate the 'shading' parameter to the new alias system (#4197)
Co-authored-by: Michael Grund <[email protected]> Co-authored-by: Yvonne Fröhlich <[email protected]>
1 parent cf93a77 commit 3921c0d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

pygmt/src/colorbar.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
C="cmap",
2020
D="position",
2121
G="truncate",
22-
I="shading",
2322
L="equalsize",
2423
Q="log",
2524
W="scale",
@@ -29,6 +28,7 @@
2928
@kwargs_to_strings(G="sequence", I="sequence", p="sequence")
3029
def colorbar(
3130
self,
31+
shading: float | Sequence[float] | bool = False,
3232
projection: str | None = None,
3333
box: Box | bool = False,
3434
region: Sequence[float | str] | str | None = None,
@@ -64,6 +64,7 @@ def colorbar(
6464
6565
{aliases}
6666
- F = box
67+
- I = shading
6768
- J = projection
6869
- R = region
6970
- V = verbose
@@ -110,12 +111,14 @@ def colorbar(
110111
scale : float
111112
Multiply all z-values in the CPT by the provided scale. By default,
112113
the CPT is used as is.
113-
shading : str, list, or bool
114-
Add illumination effects. Passing a single numerical value sets the
115-
range of intensities from -value to +value. If not specified, 1 is
116-
used. Alternatively, set ``shading=[low, high]`` to specify an
117-
asymmetric intensity range from *low* to *high*. [Default is no
118-
illumination].
114+
shading
115+
Add illumination effects [Default is no illumination].
116+
117+
- If ``True``, a default intensity range of -1 to +1 is used.
118+
- Passing a single numerical value *max_intens* sets the range of intensities
119+
from *-max_intens* to *+max_intens*.
120+
- Passing a sequence of two numerical values (*low*, *high*) sets the intensity
121+
range from *low* to *high* to specify an asymmetric range.
119122
equalsize : float or str
120123
[**i**]\ [*gap*].
121124
Equal-sized color rectangles. By default, the rectangles are scaled
@@ -162,6 +165,7 @@ def colorbar(
162165

163166
aliasdict = AliasSystem(
164167
F=Alias(box, name="box"),
168+
I=Alias(shading, name="shading", sep="/", size=2),
165169
).add_common(
166170
J=projection,
167171
R=region,

0 commit comments

Comments
 (0)