@@ -57,3 +57,74 @@ def test_colorbar_positioned_using_normalized_coords():
57
57
fig .basemap (region = [2 , 4 , 6 , 8 ], projection = "t0/2c" , frame = True )
58
58
fig .colorbar (cmap = "rainbow" , position = "n0.75/0.25+w2c" )
59
59
return fig
60
+
61
+
62
+ @pytest .mark .mpl_image_compare
63
+ def test_colorbar_box ():
64
+ """
65
+ Create colorbar with box around it.
66
+ """
67
+ fig = Figure ()
68
+ fig .colorbar (cmap = "rainbow" , box = True , position = "x0c/0c+w1c/0.5c" )
69
+ return fig
70
+
71
+
72
+ @pytest .mark .mpl_image_compare
73
+ def test_colorbar_box_with_pen ():
74
+ """
75
+ Create colorbar with box that has a different colored pen.
76
+ """
77
+ fig = Figure ()
78
+ fig .colorbar (cmap = "rainbow" , box = "+porange" , position = "x0c/0c+w1c/0.5c" )
79
+ return fig
80
+
81
+
82
+ @pytest .mark .mpl_image_compare
83
+ def test_colorbar_box_with_fill ():
84
+ """
85
+ Create colorbar with box that has a different colored fill.
86
+ """
87
+ fig = Figure ()
88
+ fig .colorbar (cmap = "rainbow" , box = "+gorange" , position = "x0c/0c+w1c/0.5c" )
89
+ return fig
90
+
91
+
92
+ @pytest .mark .mpl_image_compare
93
+ def test_colorbar_box_with_clearance ():
94
+ """
95
+ Create colorbar with box that has an x-clearance of 0.8cm and y-clearance of 0.4cm.
96
+ """
97
+ fig = Figure ()
98
+ fig .colorbar (cmap = "rainbow" , box = "+c0.8c/0.4c+porange" , position = "x0c/0c+w1c/0.5c" )
99
+ return fig
100
+
101
+
102
+ @pytest .mark .mpl_image_compare
103
+ def test_colorbar_box_with_secondary_border ():
104
+ """
105
+ Create colorbar with box that has a secondary, inner border in addition to the main
106
+ primary, outer border.
107
+ """
108
+ fig = Figure ()
109
+ fig .colorbar (cmap = "rainbow" , box = "+porange+imagenta" , position = "x0c/0c+w1c/0.5c" )
110
+ return fig
111
+
112
+
113
+ @pytest .mark .mpl_image_compare
114
+ def test_colorbar_box_with_rounded_corners ():
115
+ """
116
+ Create colorbar with box that has rounded corners.
117
+ """
118
+ fig = Figure ()
119
+ fig .colorbar (cmap = "rainbow" , box = "+porange+r" , position = "x0c/0c+w1c/0.5c" )
120
+ return fig
121
+
122
+
123
+ @pytest .mark .mpl_image_compare
124
+ def test_colorbar_box_with_offset_background ():
125
+ """
126
+ Create colorbar with box and an offset background shaded region.
127
+ """
128
+ fig = Figure ()
129
+ fig .colorbar (cmap = "rainbow" , box = "+s5p/-5p" , position = "x0c/0c+w1c/0.5c" )
130
+ return fig
0 commit comments