{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:45:43.780000Z", "iopub.status.busy": "2025-11-05T13:45:43.779924Z", "iopub.status.idle": "2025-11-05T13:45:43.783649Z", "shell.execute_reply": "2025-11-05T13:45:43.783461Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "from lets_plot import *\n", "\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:45:43.800094Z", "iopub.status.busy": "2025-11-05T13:45:43.799987Z", "iopub.status.idle": "2025-11-05T13:45:43.846026Z", "shell.execute_reply": "2025-11-05T13:45:43.845785Z" }, "pycharm": { "name": "#%%\n" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.random.seed(12)\n", "data = dict(\n", " cond=np.repeat(['A','B'], 200),\n", " rating=np.concatenate((np.random.normal(0, 1, 200), np.random.normal(1, 1.5, 200)))\n", ")\n", "\n", "ggplot(data, aes(x='rating', fill='cond')) + ggsize(500, 250) \\\n", "+ geom_density(color='dark_green', alpha=.7) + scale_fill_brewer(type='seq')" ] } ], "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": 4 }