{ "cells": [ { "cell_type": "markdown", "id": "a34845bb", "metadata": {}, "source": [ "### Catching Exception For Boxplot With Discrete Aes " ] }, { "cell_type": "code", "execution_count": 1, "id": "4080bb47", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "e39ec57d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "c8a94ce4", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = {\n", " \"alphabet\": [\"a\",\"a\",\"b\",\"a\",\"a\",\"a\",\"b\",\"b\",\"b\",\"a\",\"a\",\"a\"],\n", " \"coeff\": [\n", " 0.9898989898989898, 0.98989898989899, 0.9871794871794872,\n", " 0.9916666666666667, 0.9882352941176471, 0.9947368421052631,\n", " 0.9916666666666667, 0.9882352941176471, 0.9947368421052631,\n", " 0.9916666666666667, 0.9882352941176471, 0.9947368421052631\n", " ]\n", "}\n", "ggplot(data) + geom_boxplot(aes(\"coeff\", \"alphabet\"), orientation=\"x\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "ea6b2e13", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = {\n", " \"alphabet\": [\"a\",\"a\",\"b\",\"a\",\"a\",\"a\",\"b\",\"b\",\"b\",\"a\",\"a\",\"a\"],\n", " \"coeff\": [\n", " 0.9898989898989898, 0.98989898989899, 0.9871794871794872,\n", " 0.9916666666666667, 0.9882352941176471, 0.9947368421052631,\n", " 0.9916666666666667, 0.9882352941176471, 0.9947368421052631,\n", " 0.9916666666666667, 0.9882352941176471, 0.9947368421052631\n", " ]\n", "}\n", "ggplot(data) + geom_boxplot(aes(\"alphabet\", \"coeff\"), orientation=\"y\")" ] } ], "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.11" } }, "nbformat": 4, "nbformat_minor": 5 }