{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "sublime-compromise", "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:31:44.577742Z", "iopub.status.busy": "2024-04-17T07:31:44.577479Z", "iopub.status.idle": "2024-04-17T07:31:44.900105Z", "shell.execute_reply": "2024-04-17T07:31:44.899775Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "import pandas as pd\n", "\n", "from lets_plot import *\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "id": "convertible-update", "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:31:44.901511Z", "iopub.status.busy": "2024-04-17T07:31:44.901371Z", "iopub.status.idle": "2024-04-17T07:31:45.069186Z", "shell.execute_reply": "2024-04-17T07:31:45.068904Z" } }, "outputs": [], "source": [ "df = pd.read_csv(\"https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv\")" ] }, { "cell_type": "code", "execution_count": 3, "id": "latin-array", "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:31:45.070299Z", "iopub.status.busy": "2024-04-17T07:31:45.070201Z", "iopub.status.idle": "2024-04-17T07:31:45.099032Z", "shell.execute_reply": "2024-04-17T07:31:45.098733Z" } }, "outputs": [], "source": [ "p_plot = ggplot(df) + geom_point(aes('cty', 'hwy'))" ] }, { "cell_type": "code", "execution_count": 4, "id": "fabulous-hobby", "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:31:45.100246Z", "iopub.status.busy": "2024-04-17T07:31:45.100148Z", "iopub.status.idle": "2024-04-17T07:31:45.109077Z", "shell.execute_reply": "2024-04-17T07:31:45.108890Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "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", "bunch = GGBunch()\n", "bunch.add_plot(p_plot + ggtitle(\"panel_background=e_rect\") + theme(panel_background=e_rect), 0, 0, w, h)\n", "bunch.add_plot(p_plot + ggtitle(\"panel_border=e_rect\") + theme(panel_border=e_rect), w, 0, w, h)\n", "bunch.show()" ] } ], "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 }