{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "sublime-compromise", "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:45:14.892389Z", "iopub.status.busy": "2025-11-05T13:45:14.892260Z", "iopub.status.idle": "2025-11-05T13:45:14.895970Z", "shell.execute_reply": "2025-11-05T13:45:14.895645Z" } }, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "b96ea84f-d3d4-4328-b086-2f0c9fae437e", "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:45:14.897004Z", "iopub.status.busy": "2025-11-05T13:45:14.896900Z", "iopub.status.idle": "2025-11-05T13:45:14.898849Z", "shell.execute_reply": "2025-11-05T13:45:14.898636Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "convertible-update", "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:45:14.899659Z", "iopub.status.busy": "2025-11-05T13:45:14.899571Z", "iopub.status.idle": "2025-11-05T13:45:15.178114Z", "shell.execute_reply": "2025-11-05T13:45:15.177796Z" } }, "outputs": [], "source": [ "df = pd.read_csv(\"https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "latin-array", "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:45:15.179402Z", "iopub.status.busy": "2025-11-05T13:45:15.179282Z", "iopub.status.idle": "2025-11-05T13:45:15.206017Z", "shell.execute_reply": "2025-11-05T13:45:15.205686Z" } }, "outputs": [], "source": [ "p_plot = ggplot(df) + geom_point(aes('cty', 'hwy'))" ] }, { "cell_type": "code", "execution_count": 5, "id": "fabulous-hobby", "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:45:15.207076Z", "iopub.status.busy": "2025-11-05T13:45:15.206998Z", "iopub.status.idle": "2025-11-05T13:45:15.218175Z", "shell.execute_reply": "2025-11-05T13:45:15.217988Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "w, h = 400, 300\n", "e_rect = element_rect(color='#9e9eff', fill='#f0f8ff', size=8)\n", "\n", "# compare theme parameters: panel_background and panel_border\n", "\n", "gggrid([\n", " p_plot + ggtitle(\"panel_background=e_rect\") + theme(panel_background=e_rect),\n", " p_plot + ggtitle(\"panel_border=e_rect\") + theme(panel_border=e_rect),\n", "])" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.13" } }, "nbformat": 4, "nbformat_minor": 5 }