{ "cells": [ { "cell_type": "markdown", "id": "19b9803d-6540-4da0-b46a-8591e3aba21e", "metadata": {}, "source": [ "# Interactive Pan/Zoom with Shared Axes in `gggrid` \n", "When subplots in a `gggrid` share axes via `sharex` or `sharey`, interactive pan and zoom propagate across sibling plots. Zooming or panning one subplot automatically updates all plots sharing that axis. \n", " \n", "**Tip:** double-click a subplot to reset it.\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "69bad997-f94f-4a5a-8db4-5b2afb9a663c", "metadata": {}, "outputs": [], "source": [ "from lets_plot import *\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "id": "b272a8c1-ec28-431f-b375-1aa64901ba33", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "e0f6f6f6-9b16-4173-91d8-4ac964632959", "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", "
| 3 | \n", "16.0 | \n", "8 | \n", "304.0 | \n", "150 | \n", "3433 | \n", "12.0 | \n", "70 | \n", "US | \n", "amc rebel sst | \n", "
| 4 | \n", "17.0 | \n", "8 | \n", "302.0 | \n", "140 | \n", "3449 | \n", "10.5 | \n", "70 | \n", "US | \n", "ford torino | \n", "