@@ -106,11 +106,10 @@ def imshow(
106
106
107
107
labels : dict with str keys and str values (default `{}`)
108
108
Overrides names used in the figure for axis titles (keys ``x`` and ``y``),
109
- colorbar title (key ``colorbar``) and hover (key ``color``). The values
110
- should correspond to the desired label to be displayed. If ``img`` is an
111
- xarray, dimension names are used for axis titles, and long name for the
112
- colorbar title (unless overridden in ``labels``). Possible keys are:
113
- x, y, color and colorbar.
109
+ colorbar title and hover (key ``color``). The values should correspond
110
+ to the desired label to be displayed. If ``img`` is an xarray, dimension
111
+ names are used for axis titles, and long name for the colorbar title
112
+ (unless overridden in ``labels``). Possible keys are: x, y, and color.
114
113
115
114
color_continuous_scale : str or list of str
116
115
colormap used to map scalar data to colors (for a 2D image). This parameter is
@@ -169,7 +168,6 @@ def imshow(
169
168
args = locals ()
170
169
apply_default_cascade (args )
171
170
img_is_xarray = False
172
- colorbar_title = ""
173
171
if xarray_imported :
174
172
if isinstance (img , xarray .DataArray ):
175
173
y_label , x_label = img .dims [0 ], img .dims [1 ]
@@ -183,7 +181,6 @@ def imshow(
183
181
if aspect is None :
184
182
aspect = "auto"
185
183
z_name = xarray .plot .utils .label_from_attrs (img ).replace ("\n " , "<br>" )
186
- colorbar_title = z_name
187
184
188
185
if labels is not None :
189
186
if "x" in labels :
@@ -192,8 +189,6 @@ def imshow(
192
189
y_label = labels ["y" ]
193
190
if "color" in labels :
194
191
z_name = labels ["color" ]
195
- if "colorbar" in labels :
196
- colorbar_title = labels ["colorbar" ]
197
192
198
193
if not img_is_xarray :
199
194
if aspect is None :
@@ -226,7 +221,7 @@ def imshow(
226
221
cmid = color_continuous_midpoint ,
227
222
cmin = range_color [0 ],
228
223
cmax = range_color [1 ],
229
- colorbar = dict (title = colorbar_title ),
224
+ colorbar = dict (title = z_name ),
230
225
)
231
226
232
227
# For 2D+RGB data, use Image trace
0 commit comments