eelbrain.plot.ColorBar¶
-
class
eelbrain.plot.
ColorBar
(cmap, vmin=None, vmax=None, label=True, label_position=None, label_rotation=None, clipmin=None, clipmax=None, orientation='horizontal', unit=None, contours=(), width=None, ticks=None, threshold=None, ticklocation='auto', background='white', tight=True, h=None, w=None, **kwargs)¶ A color-bar for a matplotlib color-map
- Parameters
cmap (str | Colormap | array) – Name of the color-map, or a matplotlib Colormap, or LUT.
vmin (scalar) – Lower end of the scale mapped onto cmap.
vmax (scalar) – Upper end of the scale mapped onto cmap.
label (bool | str) – Label for the x-axis (default is the unit, or if no unit is provided the name of the colormap).
label_position ('left' | 'right' | 'top' | 'bottom') – Position of the axis label. Valid values depend on orientation.
label_rotation (scalar) – Angle of the label in degrees (For horizontal colorbars, the default is 0; for vertical colorbars, the default is 0 for labels of 3 characters and shorter, and 90 for longer labels).
clipmin (scalar) – Clip the color-bar below this value.
clipmax (scalar) – Clip the color-bar above this value.
orientation ('horizontal' | 'vertical') – Orientation of the bar (default is horizontal).
unit (str) – Unit for the axis to determine tick labels (for example,
u'µV'
to label 0.000001 as ‘1’).contours (iterator of scalar (optional)) – Plot contour lines at these values.
width (scalar) – Width of the color-bar in inches.
ticks ({float: str} dict | sequence of float) – Customize tick-labels on the colormap; either a dictionary with tick-locations and labels, or a sequence of tick locations. To draw no ticks, set to
()
.threshold (scalar) – Set the alpha of values below
threshold
to 0 (as well as for negative values aboveabs(threshold)
).ticklocation ('auto', 'top', 'bottom', 'left', 'right') – Where to place ticks and label.
background (matplotlib color) – Background color (for colormaps including transparency).
.. – Also accepts General layout parameters.
Methods¶
|
Draw a horizontal line on one or more axes |
|
Draw a horizontal bar on one or more axes |
|
Draw a vertical line on one or more axes |
|
Draw a vertical bar on one or more axes |
|
Close the figure. |
|
(Re-)draw the figure (after making manual changes). |
|
Draw crosshairs under the cursor |
|
Create FMTXT Image from the figure |
|
Short-cut for Matplotlib’s |
|
Set the figure window title |
|
Set the label for the x-axis |
|
Rotate every x-axis tick-label by an angle (counterclockwise, in degrees) |
|
Set the label for the y-axis |