expand_limits#

expand_limits(*, x=None, y=None, size=None, color=None, fill=None, alpha=None, shape=None)#

Expand the plot limits to include additional data values.

This function extends the plot boundaries to encompass new data points, whether a single value or multiple values are provided. It acts as a thin wrapper around geom_blank().

Parameters:
x, y, size, color, fill, alpha, shapeAny, list, tuple or range

List of name-value pairs specifying the value (or values) that should be included in each scale. These parameters extend the corresponding plot dimensions or aesthetic scales.

Returns:
FeatureSpec

A result of the geom_blank() call.

Examples

 1from lets_plot import *
 2LetsPlot.setup_html()
 3data = {
 4    'x': [-3, 0, 1],
 5    'y': [2, 3, -1],
 6}
 7
 8# Include the value -10 along the x-axis
 9ggplot(data, aes('x', 'y')) + geom_point() + \
10    expand_limits(x=-10)

 1from lets_plot import *
 2LetsPlot.setup_html()
 3data = {
 4    'x': [-3, 0, 1],
 5    'y': [2, 3, -1],
 6}
 7
 8# Expand Limits Along the y-axis
 9ggplot(data, aes('x', 'y')) + geom_point() + \
10    expand_limits(y=range(-10, 10))