{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# `ggbunch()`\n", "\n", "`ggbunch()` allows to show a collection of plots on one figure. Each plot in the collection can have arbitrary location and size. There is no automatic layout inside the bunch." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:48.300913Z", "iopub.status.busy": "2025-11-05T13:48:48.300788Z", "iopub.status.idle": "2025-11-05T13:48:48.304935Z", "shell.execute_reply": "2025-11-05T13:48:48.304679Z" } }, "outputs": [], "source": [ "import numpy as np\n", "\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:48.305818Z", "iopub.status.busy": "2025-11-05T13:48:48.305704Z", "iopub.status.idle": "2025-11-05T13:48:48.307696Z", "shell.execute_reply": "2025-11-05T13:48:48.307504Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:48.320833Z", "iopub.status.busy": "2025-11-05T13:48:48.320753Z", "iopub.status.idle": "2025-11-05T13:48:48.322051Z", "shell.execute_reply": "2025-11-05T13:48:48.321874Z" } }, "outputs": [], "source": [ "np.random.seed(42)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:48.322701Z", "iopub.status.busy": "2025-11-05T13:48:48.322633Z", "iopub.status.idle": "2025-11-05T13:48:48.324346Z", "shell.execute_reply": "2025-11-05T13:48:48.324166Z" } }, "outputs": [], "source": [ "cov=[[1, 0],\n", " [0, 1]]\n", "x, y = np.random.multivariate_normal(mean=[0,0], cov=cov, size=400).T\n", "\n", "data = dict(\n", " x = x,\n", " y = y\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### View this data as a scatter plot and as a histogram" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:48.325066Z", "iopub.status.busy": "2025-11-05T13:48:48.324992Z", "iopub.status.idle": "2025-11-05T13:48:48.358050Z", "shell.execute_reply": "2025-11-05T13:48:48.357851Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "