{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "sublime-compromise", "metadata": {}, "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": {}, "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": {}, "outputs": [], "source": [ "p_plot = ggplot(df) + geom_point(aes('cty', 'hwy'))" ] }, { "cell_type": "code", "execution_count": 4, "id": "fabulous-hobby", "metadata": {}, "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.7.13" } }, "nbformat": 4, "nbformat_minor": 5 }