cigvis.vispynodes.colorbar module#
- class cigvis.vispynodes.colorbar.Colorbar(size=None, cmap='gray', clim=None, discrete=False, disc_ticks=None, dpi_scale=4, label_str='Colorbar', label_color='black', label_size=None, label_bold=False, tick_size=None, border_width=None, border_color='black', height_ratio=0.96, preserve_alpha=False, savedir=None, visible=True, parent=None)#
Bases:
ImageA colorbar visual fixed to the right side of the canvas. This is based on the rendering from Matplotlib, then display this rendered image as a scene.visuals.Image visual node on the canvas.
Parameters#
- sizeTuple
cbar image size: (width, hight)
- cmapColormap
cmap
- climList
[vmin, vmax] of the cmap
- discretebool
set as discrete colorbar style if True
- disc_ticksList
Two elements, [values, ticklabels] The first element is a List which contains the avilable values, it will be used to calculate the colors from cmap and clim, i.e, get: values <–> colors. The second element is a List which contains the labels of all values, such as ‘class A’, ‘class B’, …. If len(disc_ticks) == 1, use values as the second element.
- dpi_scalefloat
dpi scale when drawing, default is 1.5, true_dpi = dpi * dpi_scale
- label_strstr
Colorbar label
- label_colorstr
colorbar label color
- label_sizeint
colorbar label size
- tick_sizeint
tick size
- border_widthfloat
border size
- border_colorColor
border color
- preserve_alphabool
Preserve cmap alpha in the Matplotlib-rendered colorbar if True. By default, colorbar colors are drawn opaque.
- savedirstr
colobar image save dir
- visablebool
visable when show
- parentAny
parent of this None
- get_ScalarMappable()#
- get_font_size(fonts)#
- on_resize(event)#
When window is resized, only need to move the position in vertical direction, because the coordinate is relative to the secondary ViewBox that stays on the right side of the canvas.
- update_params(**kwargs)#
- update_size(size)#