{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:32:12.895762Z", "iopub.status.busy": "2024-04-17T07:32:12.895680Z", "iopub.status.idle": "2024-04-17T07:32:13.220711Z", "shell.execute_reply": "2024-04-17T07:32:13.220297Z" } }, "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": "2024-04-17T07:32:13.234109Z", "iopub.status.busy": "2024-04-17T07:32:13.233799Z", "iopub.status.idle": "2024-04-17T07:32:13.281361Z", "shell.execute_reply": "2024-04-17T07:32:13.281097Z" }, "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": 2 }