ggdeck#

ggdeck(plots: list, *, scale_share: str = None) SupPlotsSpec#

Overlay several plots on one figure, with aligned drawing areas.

Parameters:
plotslist

A list of plot specifications to overlay. The first plot is the bottom layer, subsequent plots are drawn on top.

scale_sharestr, default=’x’

Controls sharing of scale limits between overlaid plots.

  • ‘x’ - share X-axis limits (the default; useful for secondary Y-axis).

  • ‘y’ - share Y-axis limits.

  • ‘all’ - share both X and Y limits.

  • ‘none’ - do not share limits.

Returns:
SupPlotsSpec

The deck specification.

Examples

 1import numpy as np
 2from lets_plot import *
 3LetsPlot.setup_html()
 4np.random.seed(42)
 5n = 50
 6x = np.arange(n)
 7data = {'x': x, 'y1': np.cumsum(np.random.normal(size=n)), 'y2': np.random.uniform(0, 10, size=n)}
 8p1 = ggplot(data, aes('x', 'y1')) + geom_line()
 9p2 = ggplot(data, aes('x', 'y2')) + geom_point(color='red')
10ggdeck([p1, p2]) + ggsize(400, 300)