7
7
8
8
@pytest .mark .benchmark
9
9
@pytest .mark .mpl_image_compare
10
- def test_colorbar_box ():
10
+ def test_colorbar ():
11
11
"""
12
- Create colorbar with box around it .
12
+ Create a simple colorbar .
13
13
"""
14
14
fig = Figure ()
15
- fig .colorbar (cmap = "rainbow" , box = True , position = "x0c/0c+w1c/0.5c" )
16
- return fig
17
-
18
-
19
- @pytest .mark .mpl_image_compare
20
- def test_colorbar_box_with_fill ():
21
- """
22
- Create colorbar with box that has a different colored fill.
23
- """
24
- fig = Figure ()
25
- fig .colorbar (cmap = "rainbow" , box = "+gorange" , position = "x0c/0c+w1c/0.5c" )
26
- return fig
27
-
28
-
29
- @pytest .mark .mpl_image_compare
30
- def test_colorbar_truncated_to_zlow_zhigh ():
31
- """
32
- Create colorbar truncated to z-low and z-high.
33
- """
34
- fig = Figure ()
35
- fig .colorbar (cmap = "rainbow" , truncate = [0.15 , 0.85 ], position = "x0c/0c+w2c/0.5c" )
36
- return fig
37
-
38
-
39
- @pytest .mark .mpl_image_compare
40
- def test_colorbar_scaled_z_values ():
41
- """
42
- Create colorbar with z-values scaled to 0.1x of the original CPT.
43
- """
44
- fig = Figure ()
45
- fig .colorbar (cmap = "rainbow" , scale = 0.1 , position = "x0c/0c+w2c/0.5c" )
46
- return fig
47
-
48
-
49
- @pytest .mark .mpl_image_compare
50
- def test_colorbar_shading_boolean ():
51
- """
52
- Create colorbar and set shading with a Boolean value.
53
- """
54
- fig = Figure ()
55
- fig .basemap (region = [0 , 10 , 0 , 10 ], projection = "X15c" , frame = "a" )
56
- fig .colorbar (cmap = "geo" , shading = True , frame = True )
15
+ fig .colorbar (cmap = "rainbow" , position = "x0c/0c+w4c" , frame = True )
57
16
return fig
58
17
59
18
@@ -63,6 +22,6 @@ def test_colorbar_shading_list():
63
22
Create colorbar and set shading by passing the high/low values as a list.
64
23
"""
65
24
fig = Figure ()
66
- fig .basemap (region = [0 , 10 , 0 , 10 ], projection = "X15c " , frame = "a" )
25
+ fig .basemap (region = [0 , 10 , 0 , 2 ], projection = "X10c/2c " , frame = "a" )
67
26
fig .colorbar (cmap = "geo" , shading = [- 0.7 , 0.2 ], frame = True )
68
27
return fig
0 commit comments