lets_plot.guides#

lets_plot.guides(**kwargs)#

Set guides for each scale.

Parameters:
kwargs

Name-guide pairs where name should be an aesthetic. The guide can either be a string (‘colorbar’, ‘legend’), or a call to a guide function (guide_colorbar(), guide_legend()) specifying additional arguments, or ‘none’ to hide the guide.

Returns:
FeatureSpec

Guides specification.

Examples

 1import numpy as np
 2from lets_plot import *
 3LetsPlot.setup_html()
 4n = 25
 5np.random.seed(42)
 6x = np.random.uniform(size=n)
 7y = np.random.uniform(size=n)
 8c = np.random.choice(list('abcdefgh'), size=n)
 9v = np.random.normal(size=n)
10ggplot({'x': x, 'y': y, 'c': c, 'v': v}, aes('x', 'y')) + \
11    geom_point(aes(shape='c', color='v'), size=4) + \
12    scale_color_gradient2(low='red', mid='yellow', high='blue') + \
13    guides(shape=guide_legend(ncol=2), \
14           color=guide_colorbar(nbin=8, barwidth=20))