Parameters ---------- ax : `~matplotlib.axes.Axes` The `~.axes.Axes` instance in which the colorbar is drawn. mappable : `.ColorizingArtist` The mappable whose colormap and norm will be used. To show the colors versus index inste
(
self, ax, mappable=None, *,
alpha=None,
location=None,
extend=None,
extendfrac=None,
extendrect=False,
ticks=None,
format=None,
values=None,
boundaries=None,
spacing='uniform',
drawedges=False,
label='',
cmap=None, norm=None, # redundant with *mappable*
orientation=None, ticklocation='auto', # redundant with *location*
)
| 235 | n_rasterize = 50 # rasterize solids if number of colors >= n_rasterize |
| 236 | |
| 237 | def __init__( |
| 238 | self, ax, mappable=None, *, |
| 239 | alpha=None, |
| 240 | location=None, |
| 241 | extend=None, |
| 242 | extendfrac=None, |
| 243 | extendrect=False, |
| 244 | ticks=None, |
| 245 | format=None, |
| 246 | values=None, |
| 247 | boundaries=None, |
| 248 | spacing='uniform', |
| 249 | drawedges=False, |
| 250 | label='', |
| 251 | cmap=None, norm=None, # redundant with *mappable* |
| 252 | orientation=None, ticklocation='auto', # redundant with *location* |
| 253 | ): |
| 254 | """ |
| 255 | Parameters |
| 256 | ---------- |
| 257 | ax : `~matplotlib.axes.Axes` |
| 258 | The `~.axes.Axes` instance in which the colorbar is drawn. |
| 259 | |
| 260 | mappable : `.ColorizingArtist` |
| 261 | The mappable whose colormap and norm will be used. |
| 262 | |
| 263 | To show the colors versus index instead of on a 0-1 scale, set the |
| 264 | mappable's norm to ``colors.NoNorm()``. |
| 265 | |
| 266 | alpha : float |
| 267 | The colorbar transparency between 0 (transparent) and 1 (opaque). |
| 268 | |
| 269 | location : None or {'left', 'right', 'top', 'bottom'} |
| 270 | Set the colorbar's *orientation* and *ticklocation*. Colorbars on |
| 271 | the left and right are vertical, colorbars at the top and bottom |
| 272 | are horizontal. The *ticklocation* is the same as *location*, so if |
| 273 | *location* is 'top', the ticks are on the top. *orientation* and/or |
| 274 | *ticklocation* can be provided as well and overrides the value set by |
| 275 | *location*, but there will be an error for incompatible combinations. |
| 276 | |
| 277 | .. versionadded:: 3.7 |
| 278 | |
| 279 | %(_colormap_kw_doc)s |
| 280 | |
| 281 | Other Parameters |
| 282 | ---------------- |
| 283 | cmap : `~matplotlib.colors.Colormap`, default: :rc:`image.cmap` |
| 284 | The colormap to use. This parameter is ignored, unless *mappable* is |
| 285 | None. |
| 286 | |
| 287 | norm : `~matplotlib.colors.Normalize` |
| 288 | The normalization to use. This parameter is ignored, unless *mappable* |
| 289 | is None. |
| 290 | |
| 291 | orientation : None or {'vertical', 'horizontal'} |
| 292 | If None, use the value determined by *location*. If both |
| 293 | *orientation* and *location* are None then defaults to 'vertical'. |
| 294 |
no test coverage detected