guide_colorbar#

guide_colorbar(title=None, *, barwidth=None, barheight=None, nbin=None)#

Continuous color bar guide.

Parameters:
titlestr

Title of guide.

barwidthfloat

Color bar width in px.

barheightfloat

Color bar height in px.

nbinint

Number of bins in color bar.

Returns:
FeatureSpec

Color guide specification.

Notes

Color bar guide shows continuous color scales mapped onto values. Color bar is available with scale_fill and scale_color.

Examples

 1import numpy as np
 2from lets_plot import *
 3LetsPlot.setup_html()
 4n = 50
 5np.random.seed(42)
 6x = np.random.uniform(size=n)
 7y = np.random.uniform(size=n)
 8v = np.random.normal(size=n)
 9ggplot({'x': x, 'y': y, 'v': v}, aes('x', 'y')) + \
10    geom_point(aes(fill='v'), size=4, shape=21, color='black') + \
11    scale_fill_gradient2(low='red', mid='yellow', high='blue', \
12                         guide=guide_colorbar(nbin=8, barwidth=10))