28
28
R = "sequence" , G = "sequence" , I = "sequence" , c = "sequence_comma" , p = "sequence"
29
29
)
30
30
def colorbar (self , ** kwargs ):
31
- """
31
+ r """
32
32
Plot a gray or color scale-bar on maps.
33
33
34
34
Both horizontal and vertical scales are supported. For CPTs with
35
35
gradational colors (i.e., the lower and upper boundary of an interval
36
36
have different colors) we will interpolate to give a continuous scale.
37
37
Variations in intensity due to shading/illumination may be displayed by
38
- setting the option -I . Colors may be spaced according to a linear
39
- scale, all be equal size, or by providing a file with individual tile
40
- widths.
38
+ setting the ``shading`` parameter . Colors may be spaced according to a
39
+ linear scale, all be equal size, or by providing a file with individual
40
+ tile widths.
41
41
42
42
Full option list at :gmt-docs:`colorbar.html`
43
43
@@ -49,52 +49,56 @@ def colorbar(self, **kwargs):
49
49
Set color bar boundary frame, labels, and axes attributes.
50
50
{CPT}
51
51
position : str
52
- ``[g|j|J|n|x]refpoint[+wlength[/width]][+e[b|f][length]][+h|v]
53
- [+jjustify][+m[a|c|l|u]][+n[txt]][+odx[/dy]]``. Defines the
54
- reference point on the map for the color scale using one of four
55
- coordinate systems: (1) Use *g* for map (user) coordinates, (2) use
56
- *j* or *J* for setting refpoint via a 2-char justification code
57
- that refers to the (invisible) map domain rectangle, (3) use *n*
58
- for normalized (0-1) coordinates, or (4) use *x* for plot
59
- coordinates (inches, cm, etc.). All but *x* requires both *region*
60
- and *projection* to be specified. Append +w followed by the length
61
- and width of the color bar. If width is not specified then it is
52
+ [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\
53
+ [**+w**\ *length*\ [/\ *width*]]\ [**+e**\ [**b**\|\ **f**][*length*]]\
54
+ [**+h**\|\ **v**][**+j**\ *justify*]\
55
+ [**+m**\ [**a**\|\ **c**\|\ **l**\|\ **u**]]\
56
+ [**+n**\ [*txt*]][**+o**\ *dx*\ [/*dy*]].
57
+ Defines the reference point on the map for the color scale using one of
58
+ four coordinate systems: (1) Use **g** for map (user) coordinates, (2)
59
+ use **j** or **J** for setting *refpoint* via a 2-char justification
60
+ code that refers to the (invisible) map domain rectangle, (3) use **n**
61
+ for normalized (0-1) coordinates, or (4) use **x** for plot
62
+ coordinates (inches, cm, etc.). All but **x** requires both ``region``
63
+ and ``projection`` to be specified. Append **+w** followed by the
64
+ length and width of the color bar. If width is not specified then it is
62
65
set to 4% of the given length. Give a negative length to reverse
63
- the scale bar. Append +h to get a horizontal scale
64
- [Default is vertical (+v )]. By default, the anchor point on the
65
- scale is assumed to be the bottom left corner (BL ), but this can be
66
- changed by appending +j followed by a 2-char justification code
66
+ the scale bar. Append **+h** to get a horizontal scale
67
+ [Default is vertical (**+v** )]. By default, the anchor point on the
68
+ scale is assumed to be the bottom left corner (**BL** ), but this can be
69
+ changed by appending **+j** followed by a 2-char justification code
67
70
*justify*.
68
71
box : bool or str
69
- ``[+cclearances][+gfill][+i[[gap/]pen]][+p[pen]][+r[radius]]
70
- [+s[[dx/dy/][shade]]]``. If set to True, draws a rectangular
71
- border around the color scale. Alternatively, specify a different
72
- pen with +ppen. Add +gfill to fill the scale panel [no fill].
73
- Append +cclearance where clearance is either gap, xgap/ygap, or
74
- lgap/rgap/bgap/tgap where these items are uniform, separate in x-
75
- and y-direction, or individual side spacings between scale and
76
- border. Append +i to draw a secondary, inner border as well. We use
77
- a uniform gap between borders of 2p and the MAP_DEFAULTS_PEN unless
78
- other values are specified. Append +r to draw rounded rectangular
79
- borders instead, with a 6p corner radius. You can override this
80
- radius by appending another value. Finally, append +s to draw an
81
- offset background shaded region. Here, dx/dy indicates the shift
72
+ [**+c**\ *clearances*][**+g**\ *fill*][**+i**\ [[*gap*/]\ *pen*]]\
73
+ [**+p**\ [*pen*]][**+r**\ [*radius*]][**+s**\ [[*dx*/*dy*/][*shade*]]].
74
+ If set to ``True``, draws a rectangular border around the color scale.
75
+ Alternatively, specify a different pen with **+p**\ *pen*. Add
76
+ **+g**\ *fill* to fill the scale panel [default is no fill]. Append
77
+ **+c**\ *clearance* where *clearance* is either gap, xgap/ygap, or
78
+ lgap/rgap/bgap/tgap where these items are uniform, separate in x- and
79
+ y-direction, or individual side spacings between scale and border.
80
+ Append **+i** to draw a secondary, inner border as well. We use a
81
+ uniform gap between borders of 2p and the :gmt-term:`MAP_DEFAULTS_PEN`
82
+ unless other values are specified. Append **+r** to draw rounded
83
+ rectangular borders instead, with a 6p corner radius. You can override
84
+ this radius by appending another value. Finally, append **+s** to draw
85
+ an offset background shaded region. Here, *dx/dy* indicates the shift
82
86
relative to the foreground frame [4p/-4p] and shade sets the fill
83
- style to use for shading [gray50].
87
+ style to use for shading [default is gray50].
84
88
truncate : list or str
85
- `` zlo/ zhi`` Truncate the incoming CPT so that the lowest and
86
- highest z-levels are to zlo and zhi. If one of these equal NaN then
87
- we leave that end of the CPT alone. The truncation takes place
88
- before the plotting.
89
+ * zlo*/* zhi*.
90
+ Truncate the incoming CPT so that the lowest and highest z-levels are
91
+ to *zlo* and *zhi*. If one of these equal NaN then we leave that end of
92
+ the CPT alone. The truncation takes place before the plotting.
89
93
scale : float
90
94
Multiply all z-values in the CPT by the provided scale. By default
91
95
the CPT is used as is.
92
96
shading : str or list or bool
93
97
Add illumination effects. Passing a single numerical value sets the
94
98
range of intensities from -value to +value. If not specified, 1 is
95
99
used. Alternatively, set ``shading=[low, high]`` to specify an
96
- asymmetric intensity range from *low* to *high*. The default is no
97
- illumination.
100
+ asymmetric intensity range from *low* to *high*. [Default is no
101
+ illumination] .
98
102
{V}
99
103
{XY}
100
104
{c}
0 commit comments