lets_plot.lims#

lets_plot.lims(x, y)#

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

Parameters:
xlist of float

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

ylist of float

Limits (2 elements) for the y axis. 1st element defines lower limit, 2nd element defines upper limit. None value in list 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])