lets_plot.lims

lets_plot.lims(x, y)

This is a shortcut for supplying the limits parameter to the x and y scales. Observations outside the range will be dropped.

Parameters
xlist or None

Limits (2 elements) for the x axis. 1st element defines lower limit, 2nd element defines upper limit. None means no bounds.

ylist or None

Limits (2 elements) for the y axis. 1st element defines lower limit, 2nd element defines upper limit. None means no bounds.

Returns
FeatureSpec

Scale specification.

Examples

1import numpy as np
2from lets_plot import *
3LetsPlot.setup_html()
4n = 1000
5np.random.seed(42)
6x = np.random.normal(size=n)
7y = np.random.normal(size=n)
8ggplot({'x': x, 'y': y}, aes('x', 'y')) + \
9    geom_point() + lims([-2, 2], [-2, 2])