From 3134ddff822a7fb7aa6427c31d377cd541f6188b Mon Sep 17 00:00:00 2001 From: Johannes Frohnmeyer Date: Sun, 9 Apr 2023 14:52:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EREADME.ipynb=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.ipynb | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 - 2 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 README.ipynb delete mode 100644 README.md diff --git a/README.ipynb b/README.ipynb new file mode 100644 index 0000000..e64e3d8 --- /dev/null +++ b/README.ipynb @@ -0,0 +1,151 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": true, + "ExecuteTime": { + "start_time": "2023-04-09T14:51:08.170723Z", + "end_time": "2023-04-09T14:51:11.133364Z" + } + }, + "outputs": [ + { + "data": { + "text/html": "
\n " + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "%use lets-plot" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "outputs": [], + "source": [ + "val data = mapOf(\n", + " \"cat1\" to listOf(\"a\", \"a\", \"b\", \"a\", \"a\", \"a\", \"a\", \"b\", \"b\", \"b\", \"b\"),\n", + " \"cat2\" to listOf(\"c\", \"c\", \"d\", \"d\", \"d\", \"c\", \"c\", \"d\", \"c\", \"c\", \"d\")\n", + ")\n", + "val p = letsPlot(data)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "start_time": "2023-04-09T14:51:11.130076Z", + "end_time": "2023-04-09T14:51:11.217759Z" + } + } + }, + { + "cell_type": "code", + "execution_count": 10, + "outputs": [ + { + "data": { + "text/html": "
\n " + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "val layer = geomBar {\n", + " x = \"cat1\"\n", + " fill = \"cat2\"\n", + "}\n", + "\n", + "(p + layer)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "start_time": "2023-04-09T14:51:11.217423Z", + "end_time": "2023-04-09T14:51:11.329998Z" + } + } + }, + { + "cell_type": "code", + "execution_count": 11, + "outputs": [], + "source": [ + "val rand = java.util.Random(1024)\n", + "val data = mapOf (\n", + " \"rating\" to List(200) { rand.nextGaussian() } + List(200) { rand.nextGaussian() * 1.5 + 1.5 },\n", + " \"cond\" to List(200) { \"A\" } + List(200) { \"B\" }\n", + ")\n", + "var p = letsPlot(data)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "start_time": "2023-04-09T14:51:11.326669Z", + "end_time": "2023-04-09T14:51:11.491370Z" + } + } + }, + { + "cell_type": "code", + "execution_count": 12, + "outputs": [ + { + "data": { + "text/html": "
\n " + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "p += geomDensity(color=\"dark_green\", alpha=.3) {x=\"rating\"; fill=\"cond\"}\n", + "p + ggsize(700, 350)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "start_time": "2023-04-09T14:51:11.489478Z", + "end_time": "2023-04-09T14:51:11.620755Z" + } + } + }, + { + "cell_type": "code", + "execution_count": 13, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "start_time": "2023-04-09T14:51:11.620416Z", + "end_time": "2023-04-09T14:51:11.654766Z" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Kotlin", + "language": "kotlin", + "name": "kotlin" + }, + "language_info": { + "name": "kotlin", + "version": "1.8.0", + "mimetype": "text/x-kotlin", + "file_extension": ".kt", + "pygments_lexer": "kotlin", + "codemirror_mode": "text/x-kotlin", + "nbconvert_exporter": "" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/README.md b/README.md deleted file mode 100644 index 99cfbed..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Playground - -Playground for testing things like the MD syntax \ No newline at end of file