{ "cells": [ { "cell_type": "markdown", "id": "9a1e235f-7006-4656-8e0f-f57da158c04d", "metadata": {}, "source": [ "# Expanding Plot Limits with `expand_limits()`\n", "\n", "When creating visualizations, you might occasionally need to adjust your plot boundaries to encompass specific data points or values. This is where the `expand_limits()` function comes in handy. It allows you to extend the plot's scales to include particular values, ensuring they're visible in your visualization.\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "984c7118-bef0-4362-bee5-b4b500e62d65", "metadata": {}, "outputs": [], "source": [ "from lets_plot import *\n", "import pandas as pd\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "aaf39f46-4153-4ad4-98ea-15a5e8c1262c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "4678d72d-fc0d-4d51-b6c6-3dead0bd5ad1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "| \n", " | miles per gallon | \n", "number of cylinders | \n", "engine displacement (cu. inches) | \n", "engine horsepower | \n", "vehicle weight (lbs.) | \n", "time to accelerate (sec.) | \n", "model year | \n", "origin of car | \n", "vehicle name | \n", "
|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "18.0 | \n", "8 | \n", "307.0 | \n", "130 | \n", "3504 | \n", "12.0 | \n", "70 | \n", "US | \n", "chevrolet chevelle malibu | \n", "
| 1 | \n", "15.0 | \n", "8 | \n", "350.0 | \n", "165 | \n", "3693 | \n", "11.5 | \n", "70 | \n", "US | \n", "buick skylark 320 | \n", "
| 2 | \n", "18.0 | \n", "8 | \n", "318.0 | \n", "150 | \n", "3436 | \n", "11.0 | \n", "70 | \n", "US | \n", "plymouth satellite | \n", "