lets_plot.sampling_systematic

lets_plot.sampling_systematic(n)

Return a subset where items are selected at a regular interval.

Parameters

n (int) – Number of items to return.

Returns

Systematic sample specification.

Return type

FeatureSpec

Examples

1import numpy as np
2from lets_plot import *
3LetsPlot.setup_html()
4n = 1000
5x = np.arange(n)
6np.random.seed(12)
7y = np.random.normal(0, 1, n)
8ggplot({'x': x, 'y': y}, aes(x='x', y='y')) + \
9    geom_line(sampling=sampling_systematic(50))