lets_plot.guide_colorbar

lets_plot.guide_colorbar(barwidth=None, barheight=None, nbin=None)

Continuous color bar guide.

Parameters
  • barwidth (float) – Color bar width.

  • barheight (float) – Color bar height.

  • nbin (int) – Number of bins in color bar.

Returns

Color guide specification.

Return type

FeatureSpec

Note

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))