{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "524046f7-1406-4283-b8f7-085374a13479", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "import pandas as pd\n", "from lets_plot import *\n", "\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "id": "c9e777c5-b196-4af8-83e8-bd1dbe00d9f7", "metadata": {}, "outputs": [], "source": [ "df = pd.DataFrame({\n", " \"id\": list(range(1, 11)),\n", " \"x\": [4, np.nan, 1, 9, 6, 2, 10, np.nan, 7, 5],\n", " \"y\": [7, 1, 9, 10, 4, np.nan, 3, np.nan, 6, 5],\n", " \"start\": [0,0,0,0,0,0,0,0,0,0]\n", "})" ] }, { "cell_type": "code", "execution_count": 3, "id": "1def5066-d800-47e6-b643-a7050254f781", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_point()" ] }, { "cell_type": "code", "execution_count": 4, "id": "3172d54c-8ea8-4849-b8c9-cfe8a412923e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_pointdensity(stat=\"identity\")" ] }, { "cell_type": "code", "execution_count": 5, "id": "634c648e-9842-43d4-b51f-ad138b3b66ee", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_qq(stat=\"identity\")" ] }, { "cell_type": "code", "execution_count": 6, "id": "363f307c-513d-4387-9eaa-5ad36a470aa5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_qq2(stat=\"identity\")" ] }, { "cell_type": "code", "execution_count": 7, "id": "a6ad4016-cead-41d3-a021-f68b4bc064de", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_area()" ] }, { "cell_type": "code", "execution_count": 8, "id": "9a4d97f5-a7a6-4142-bfd4-afc6ca1b8664", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_jitter()" ] }, { "cell_type": "code", "execution_count": 9, "id": "663bd9a3-464a-448d-8418-8393e4fbcc7d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_line()" ] }, { "cell_type": "code", "execution_count": 10, "id": "68fc1a7c-1af6-4e76-b0b5-94b90149e87d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_map()" ] }, { "cell_type": "code", "execution_count": 11, "id": "71073e5f-9970-44e7-83dc-83f4c688650f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_path()" ] }, { "cell_type": "code", "execution_count": 12, "id": "433691b2-3cdb-449e-91c9-c90abafde839", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_polygon()" ] }, { "cell_type": "code", "execution_count": 13, "id": "83cfd59a-3c3c-44b8-91a7-f7ca0116c19b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\")) + geom_ribbon(aes(ymin=\"start\", ymax=\"y\"))" ] }, { "cell_type": "code", "execution_count": 14, "id": "9eae189e-93f7-485f-99dc-e6802018b78f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "
\n", "
\n", " \n", " \n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ggplot(df, aes(\"x\", \"y\")) + geom_step()" ] } ], "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.9.20" } }, "nbformat": 4, "nbformat_minor": 5 }