|
7 | 7 |
|
8 | 8 | from pygmt.alias import Alias, AliasSystem |
9 | 9 | from pygmt.clib import Session |
10 | | -from pygmt.helpers import build_arg_list, fmt_docstring, kwargs_to_strings, use_alias |
| 10 | +from pygmt.helpers import build_arg_list, fmt_docstring, use_alias |
11 | 11 | from pygmt.params import Box |
12 | 12 |
|
13 | 13 | __doctest_skip__ = ["colorbar"] |
14 | 14 |
|
15 | 15 |
|
16 | 16 | @fmt_docstring |
17 | | -@use_alias( |
18 | | - C="cmap", D="position", G="truncate", L="equalsize", Q="log", W="scale", Z="zfile" |
19 | | -) |
20 | | -@kwargs_to_strings(G="sequence", I="sequence") |
21 | | -def colorbar( |
| 17 | +@use_alias(C="cmap", D="position", L="equalsize", Q="log", W="scale", Z="zfile") |
| 18 | +def colorbar( # noqa: PLR0913 |
22 | 19 | self, |
| 20 | + truncate: Sequence[float] | None = None, |
23 | 21 | shading: float | Sequence[float] | bool = False, |
24 | 22 | projection: str | None = None, |
25 | 23 | box: Box | bool = False, |
@@ -59,6 +57,7 @@ def colorbar( |
59 | 57 | {aliases} |
60 | 58 | - B = frame |
61 | 59 | - F = box |
| 60 | + - G = truncate |
62 | 61 | - I = shading |
63 | 62 | - J = projection |
64 | 63 | - R = region |
@@ -99,11 +98,11 @@ def colorbar( |
99 | 98 | rectangular box is drawn using :gmt-term:`MAP_FRAME_PEN`. To customize the box |
100 | 99 | appearance, pass a :class:`pygmt.params.Box` object to control style, fill, pen, |
101 | 100 | and other box properties. |
102 | | - truncate : list or str |
103 | | - *zlo*/*zhi*. |
104 | | - Truncate the incoming CPT so that the lowest and highest z-levels are |
105 | | - to *zlo* and *zhi*. If one of these equal NaN then we leave that end of |
106 | | - the CPT alone. The truncation takes place before the plotting. |
| 101 | + truncate |
| 102 | + (*zlow*, *zhigh*). |
| 103 | + Truncate the incoming CPT so that the lowest and highest z-levels are to *zlow* |
| 104 | + and *zhigh*. If one of these equal NaN then we leave that end of the CPT alone. |
| 105 | + The truncation takes place before the plotting. |
107 | 106 | scale : float |
108 | 107 | Multiply all z-values in the CPT by the provided scale. By default, |
109 | 108 | the CPT is used as is. |
@@ -161,6 +160,7 @@ def colorbar( |
161 | 160 |
|
162 | 161 | aliasdict = AliasSystem( |
163 | 162 | F=Alias(box, name="box"), |
| 163 | + G=Alias(truncate, name="truncate", sep="/", size=2), |
164 | 164 | I=Alias(shading, name="shading", sep="/", size=2), |
165 | 165 | ).add_common( |
166 | 166 | B=frame, |
|
0 commit comments