{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "driven-lafayette", "metadata": { "execution": { "iopub.execute_input": "2024-06-03T14:07:12.398094Z", "iopub.status.busy": "2024-06-03T14:07:12.398000Z", "iopub.status.idle": "2024-06-03T14:07:12.738748Z", "shell.execute_reply": "2024-06-03T14:07:12.738297Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "from lets_plot import *\n", "LetsPlot.setup_html()\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "novel-pricing", "metadata": { "execution": { "iopub.execute_input": "2024-06-03T14:07:12.740239Z", "iopub.status.busy": "2024-06-03T14:07:12.740102Z", "iopub.status.idle": "2024-06-03T14:07:12.774148Z", "shell.execute_reply": "2024-06-03T14:07:12.773921Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n = 100\n", "np.random.seed(42)\n", "x = np.random.normal(size=n)\n", "group = np.random.choice(['a', 'b'], size=n)\n", "p = ggplot({'x': x, 'group': group}, aes(x='x')) + geom_histogram() \n", "p" ] }, { "cell_type": "code", "execution_count": 3, "id": "canadian-gateway", "metadata": { "execution": { "iopub.execute_input": "2024-06-03T14:07:12.775411Z", "iopub.status.busy": "2024-06-03T14:07:12.775319Z", "iopub.status.idle": "2024-06-03T14:07:12.778091Z", "shell.execute_reply": "2024-06-03T14:07:12.777905Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p + theme_bw() + ggtitle(\"theme_bw()\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "worst-hours", "metadata": { "execution": { "iopub.execute_input": "2024-06-03T14:07:12.779245Z", "iopub.status.busy": "2024-06-03T14:07:12.779146Z", "iopub.status.idle": "2024-06-03T14:07:12.781810Z", "shell.execute_reply": "2024-06-03T14:07:12.781631Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p + facet_wrap(facets='group', ncol=2)+ theme_bw()" ] } ], "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 }