@@ -149,17 +149,15 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None):
149
149
norm = mpl .colors .Normalize (vmin = 1 , vmax = 17 )
150
150
# Create an empty ScalarMappable to set the colorbar's colormap and norm.
151
151
# The following gives a basic continuous colorbar with ticks and labels.
152
- cb1 = fig .colorbar (mpl .cm .ScalarMappable (cmap = cmap , norm = norm ),
153
- cax = axl , orientation = 'horizontal' )
154
- cb1 .set_label ('Some Units' )
152
+ fig .colorbar (mpl .cm .ScalarMappable (cmap = cmap , norm = norm ),
153
+ cax = axl , orientation = 'horizontal' , label = 'Some Units' )
155
154
156
155
157
156
# And again for the second colorbar.
158
157
cmap2 = mpl .cm .cool
159
158
norm2 = mpl .colors .Normalize (vmin = 1 , vmax = 17 )
160
- cb2 = fig .colorbar (mpl .cm .ScalarMappable (cmap = cmap2 , norm = norm2 ),
161
- cax = axl2 , orientation = 'horizontal' )
162
- cb2 .set_label ('Some other units' )
159
+ fig .colorbar (mpl .cm .ScalarMappable (cmap = cmap2 , norm = norm2 ),
160
+ cax = axl2 , orientation = 'horizontal' , label = 'Some other units' )
163
161
164
162
165
163
# The second example illustrates the use of a ListedColormap, a
@@ -173,15 +171,15 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None):
173
171
# monotonically increasing.
174
172
bounds = [2 , 3 , 7 , 9 , 15 ]
175
173
norm3 = mpl .colors .BoundaryNorm (bounds , cmap3 .N )
176
- cb3 = fig .colorbar (mpl .cm .ScalarMappable (cmap = cmap3 , norm = norm3 ),
177
- cax = axl3 ,
178
- # to use 'extend', you must specify two extra boundaries:
179
- boundaries = [0 ] + bounds + [18 ],
180
- extend = 'both' ,
181
- ticks = bounds , # optional
182
- spacing = 'proportional' ,
183
- orientation = 'horizontal' )
184
- cb3 . set_label ( 'Discrete intervals, some other units' )
174
+ fig .colorbar (mpl .cm .ScalarMappable (cmap = cmap3 , norm = norm3 ),
175
+ cax = axl3 ,
176
+ # to use 'extend', you must specify two extra boundaries:
177
+ boundaries = [0 ] + bounds + [18 ],
178
+ extend = 'both' ,
179
+ ticks = bounds , # optional
180
+ spacing = 'proportional' ,
181
+ orientation = 'horizontal' ,
182
+ label = 'Discrete intervals, some other units' )
185
183
186
184
187
185
# Create the 17 segment model
0 commit comments