source/kotlin_examples/cookbook/default_theme.ipynb (732 lines of code) (raw):

{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "subjective-telling", "metadata": { "execution": { "iopub.execute_input": "2025-12-03T16:01:37.432342Z", "iopub.status.busy": "2025-12-03T16:01:37.429543Z", "iopub.status.idle": "2025-12-03T16:01:39.444476Z", "shell.execute_reply": "2025-12-03T16:01:39.443817Z" } }, "outputs": [ { "data": { "text/html": [ " <div id=\"r2CVJ6\"></div>\n", " <script type=\"text/javascript\" data-lets-plot-script=\"library\">\n", " if(!window.letsPlotCallQueue) {\n", " window.letsPlotCallQueue = [];\n", " }; \n", " window.letsPlotCall = function(f) {\n", " window.letsPlotCallQueue.push(f);\n", " };\n", " (function() {\n", " var script = document.createElement(\"script\");\n", " script.type = \"text/javascript\";\n", " script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.8.1/js-package/distr/lets-plot.min.js\";\n", " script.onload = function() {\n", " window.letsPlotCall = function(f) {f();};\n", " window.letsPlotCallQueue.forEach(function(f) {f();});\n", " window.letsPlotCallQueue = [];\n", " \n", " \n", " };\n", " script.onerror = function(event) {\n", " window.letsPlotCall = function(f) {};\n", " window.letsPlotCallQueue = [];\n", " var div = document.createElement(\"div\");\n", " div.style.color = 'darkred';\n", " div.textContent = 'Error loading Lets-Plot JS';\n", " document.getElementById(\"r2CVJ6\").appendChild(div);\n", " };\n", " var e = document.getElementById(\"r2CVJ6\");\n", " e.appendChild(script);\n", " })();\n", " </script>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ " <div id=\"kotlin_out_0\"></div>\n", " <script type=\"text/javascript\">\n", " if(!window.kotlinQueues) {\n", " window.kotlinQueues = {};\n", " }\n", " if(!window.kotlinQueues[\"letsPlotJs\"]) {\n", " var resQueue = [];\n", " window.kotlinQueues[\"letsPlotJs\"] = resQueue;\n", " window[\"call_letsPlotJs\"] = function(f) {\n", " resQueue.push(f);\n", " }\n", " }\n", " (function (){\n", " var modifiers = [(function(script) {\n", " script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.8.1/js-package/distr/lets-plot.min.js\"\n", " script.type = \"text/javascript\";\n", "})];\n", " var e = document.getElementById(\"kotlin_out_0\");\n", " modifiers.forEach(function (gen) {\n", " var script = document.createElement(\"script\");\n", " gen(script)\n", " script.addEventListener(\"load\", function() {\n", " window[\"call_letsPlotJs\"] = function(f) {f();};\n", " window.kotlinQueues[\"letsPlotJs\"].forEach(function(f) {f();});\n", " window.kotlinQueues[\"letsPlotJs\"] = [];\n", " }, false);\n", " script.addEventListener(\"error\", function() {\n", " window[\"call_letsPlotJs\"] = function(f) {};\n", " window.kotlinQueues[\"letsPlotJs\"] = [];\n", " var div = document.createElement(\"div\");\n", " div.style.color = 'darkred';\n", " div.textContent = 'Error loading resource letsPlotJs';\n", " document.getElementById(\"kotlin_out_0\").appendChild(div);\n", " }, false);\n", " \n", " e.appendChild(script);\n", " });\n", " })();\n", " </script>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%useLatestDescriptors\n", "%use lets-plot" ] }, { "cell_type": "code", "execution_count": 2, "id": "6cd3bd01-57ba-4ab1-bad6-fa1a3777b1b0", "metadata": { "execution": { "iopub.execute_input": "2025-12-03T16:01:39.446867Z", "iopub.status.busy": "2025-12-03T16:01:39.446657Z", "iopub.status.idle": "2025-12-03T16:01:39.485314Z", "shell.execute_reply": "2025-12-03T16:01:39.484900Z" } }, "outputs": [ { "data": { "text/plain": [ "Lets-Plot Kotlin API v.4.12.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.8.1.\n", "Outputs: Web (HTML+JS), Kotlin Notebook (Swing), Static SVG (hidden)" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "LetsPlot.getInfo()" ] }, { "cell_type": "code", "execution_count": 3, "id": "swiss-conservative", "metadata": { "execution": { "iopub.execute_input": "2025-12-03T16:01:39.486611Z", "iopub.status.busy": "2025-12-03T16:01:39.486361Z", "iopub.status.idle": "2025-12-03T16:01:39.521234Z", "shell.execute_reply": "2025-12-03T16:01:39.521058Z" } }, "outputs": [], "source": [ "// Set the 'grey' theme as a default plot theme.\n", "LetsPlot.theme = themeGrey()" ] }, { "cell_type": "code", "execution_count": 4, "id": "affected-chancellor", "metadata": { "execution": { "iopub.execute_input": "2025-12-03T16:01:39.522465Z", "iopub.status.busy": "2025-12-03T16:01:39.522163Z", "iopub.status.idle": "2025-12-03T16:01:39.832909Z", "shell.execute_reply": "2025-12-03T16:01:39.832654Z" } }, "outputs": [ { "data": { "text/html": [ " <div id=\"tZCxM7\"></div>\n", " <script type=\"text/javascript\" data-lets-plot-script=\"library\">\n", " if(!window.letsPlotCallQueue) {\n", " window.letsPlotCallQueue = [];\n", " }; \n", " window.letsPlotCall = function(f) {\n", " window.letsPlotCallQueue.push(f);\n", " };\n", " (function() {\n", " var script = document.createElement(\"script\");\n", " script.type = \"text/javascript\";\n", " script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.8.1/js-package/distr/lets-plot.min.js\";\n", " script.onload = function() {\n", " window.letsPlotCall = function(f) {f();};\n", " window.letsPlotCallQueue.forEach(function(f) {f();});\n", " window.letsPlotCallQueue = [];\n", " \n", " \n", " };\n", " script.onerror = function(event) {\n", " window.letsPlotCall = function(f) {};\n", " window.letsPlotCallQueue = [];\n", " var div = document.createElement(\"div\");\n", " div.style.color = 'darkred';\n", " div.textContent = 'Error loading Lets-Plot JS';\n", " document.getElementById(\"tZCxM7\").appendChild(div);\n", " };\n", " var e = document.getElementById(\"tZCxM7\");\n", " e.appendChild(script);\n", " })();\n", " </script>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/plot+json": { "apply_color_scheme": true, "output": { "data": { "x": [ 1.0, 2.0, 3.0 ], "y": [ 1.0, 2.0, 3.0 ] }, "data_meta": { "series_annotations": [ { "column": "x", "type": "int" }, { "column": "y", "type": "int" } ] }, "kind": "plot", "layers": [ { "geom": "point", "mapping": {}, "position": "identity", "size": 5.0, "stat": "identity" } ], "mapping": { "x": "x", "y": "y" }, "scales": [], "theme": { "name": "grey" } }, "output_type": "lets_plot_spec", "swing_enabled": true }, "text/html": [ " <div id=\"GPfiJq\" ></div>\n", " <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n", " \n", " (function() {\n", " // ----------\n", " \n", " const forceImmediateRender = false;\n", " const responsive = false;\n", " \n", " let sizing = {\n", " width_mode: \"MIN\",\n", " height_mode: \"SCALED\",\n", " width: null, \n", " height: null \n", " };\n", " \n", " const preferredWidth = document.body.dataset.letsPlotPreferredWidth;\n", " if (preferredWidth !== undefined) {\n", " sizing = {\n", " width_mode: 'FIXED',\n", " height_mode: 'SCALED',\n", " width: parseFloat(preferredWidth)\n", " };\n", " }\n", " \n", " const containerDiv = document.getElementById(\"GPfiJq\");\n", " let fig = null;\n", " \n", " function renderPlot() {\n", " if (fig === null) {\n", " const plotSpec = {\n", "\"mapping\":{\n", "\"x\":\"x\",\n", "\"y\":\"y\"\n", "},\n", "\"data\":{\n", "\"x\":[1.0,2.0,3.0],\n", "\"y\":[1.0,2.0,3.0]\n", "},\n", "\"kind\":\"plot\",\n", "\"scales\":[],\n", "\"layers\":[{\n", "\"mapping\":{\n", "},\n", "\"stat\":\"identity\",\n", "\"size\":5.0,\n", "\"position\":\"identity\",\n", "\"geom\":\"point\",\n", "\"data\":{\n", "}\n", "}],\n", "\"theme\":{\n", "\"name\":\"grey\"\n", "},\n", "\"data_meta\":{\n", "\"series_annotations\":[{\n", "\"type\":\"int\",\n", "\"column\":\"x\"\n", "},{\n", "\"type\":\"int\",\n", "\"column\":\"y\"\n", "}]\n", "},\n", "\"spec_id\":\"1\"\n", "};\n", " window.letsPlotCall(function() { fig = LetsPlot.buildPlotFromProcessedSpecs(plotSpec, containerDiv, sizing); });\n", " } else {\n", " fig.updateView({});\n", " }\n", " }\n", " \n", " const renderImmediately = \n", " forceImmediateRender || (\n", " sizing.width_mode === 'FIXED' && \n", " (sizing.height_mode === 'FIXED' || sizing.height_mode === 'SCALED')\n", " );\n", " \n", " if (renderImmediately) {\n", " renderPlot();\n", " }\n", " \n", " if (!renderImmediately || responsive) {\n", " // Set up observer for initial sizing or continuous monitoring\n", " var observer = new ResizeObserver(function(entries) {\n", " for (let entry of entries) {\n", " if (entry.contentBoxSize && \n", " entry.contentBoxSize[0].inlineSize > 0) {\n", " if (!responsive && observer) {\n", " observer.disconnect();\n", " observer = null;\n", " }\n", " renderPlot();\n", " if (!responsive) {\n", " break;\n", " }\n", " }\n", " }\n", " });\n", " \n", " observer.observe(containerDiv);\n", " }\n", " \n", " // ----------\n", " })();\n", " \n", " </script> <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" display=\"block\" class=\"plt-container\" id=af8c36f8-553a-49e1-a0b4-aff451714814 width=\"100%\" height=\"100%\" style=\"max-width: 600.0px; max-height: 400.0px;\" viewBox=\"0 0 600.0 400.0\" preserveAspectRatio=\"xMinYMin meet\">\n", " <style type=\"text/css\">\n", " .plt-container {\n", " font-family: sans-serif;\n", " user-select: none;\n", " -webkit-user-select: none;\n", " -moz-user-select: none;\n", " -ms-user-select: none;\n", "}\n", "text {\n", " text-rendering: optimizeLegibility;\n", "}\n", "#pgr48HH .plot-title {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 16.0px;\n", "\n", "}\n", "#pgr48HH .plot-subtitle {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 15.0px;\n", "\n", "}\n", "#pgr48HH .plot-caption {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#pgr48HH .hyperlink-element {\n", "fill: #118ed8;\n", "font-weight: normal;\n", "font-style: normal;\n", "\n", "}\n", "#pgr48HH .legend-title {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 15.0px;\n", "\n", "}\n", "#pgr48HH .legend-item {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#pgr48HH .axis-title-x {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 15.0px;\n", "\n", "}\n", "#pgr48HH .axis-text-x {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dw6VD0Z .axis-tooltip-text-x {\n", "fill: #ffffff;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#pgr48HH .axis-title-y {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 15.0px;\n", "\n", "}\n", "#pgr48HH .axis-text-y {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dw6VD0Z .axis-tooltip-text-y {\n", "fill: #ffffff;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#pgr48HH .facet-strip-text-x {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#pgr48HH .facet-strip-text-y {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dw6VD0Z .tooltip-text {\n", "fill: #474747;\n", "font-weight: normal;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dw6VD0Z .tooltip-title {\n", "fill: #474747;\n", "font-weight: bold;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dw6VD0Z .tooltip-label {\n", "fill: #474747;\n", "font-weight: bold;\n", "font-style: normal;\n", "font-family: sans-serif;\n", "font-size: 13.0px;\n", "\n", "}\n", "\n", " </style>\n", " <g id=\"pgr48HH\">\n", " <path fill-rule=\"evenodd\" fill=\"rgb(255,255,255)\" fill-opacity=\"1.0\" d=\"M0.0 0.0 L0.0 400.0 L600.0 400.0 L600.0 0.0 Z\">\n", " </path>\n", " <g transform=\"translate(21.0 6.0 ) \">\n", " <g>\n", " <rect x=\"27.034701220281416\" y=\"0.0\" height=\"354.0\" width=\"545.9652987797186\" fill=\"rgb(235,235,235)\" fill-opacity=\"1.0\">\n", " </rect>\n", " <g transform=\"translate(27.034701220281416 0.0 ) \">\n", " <g>\n", " <line x1=\"86.85811571495523\" y1=\"0.0\" x2=\"86.85811571495523\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"0.5\" fill=\"none\">\n", " </line>\n", " <line x1=\"210.94113816489127\" y1=\"0.0\" x2=\"210.94113816489127\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"0.5\" fill=\"none\">\n", " </line>\n", " <line x1=\"335.0241606148272\" y1=\"0.0\" x2=\"335.0241606148272\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"0.5\" fill=\"none\">\n", " </line>\n", " <line x1=\"459.1071830647634\" y1=\"0.0\" x2=\"459.1071830647634\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"0.5\" fill=\"none\">\n", " </line>\n", " <line x1=\"24.816604489987213\" y1=\"0.0\" x2=\"24.816604489987213\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " <line x1=\"148.89962693992325\" y1=\"0.0\" x2=\"148.89962693992325\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " <line x1=\"272.98264938985926\" y1=\"0.0\" x2=\"272.98264938985926\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " <line x1=\"397.0656718397953\" y1=\"0.0\" x2=\"397.0656718397953\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " <line x1=\"521.1486942897313\" y1=\"0.0\" x2=\"521.1486942897313\" y2=\"354.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " </g>\n", " </g>\n", " <g transform=\"translate(27.034701220281416 0.0 ) \">\n", " <g>\n", " <line x1=\"0.0\" y1=\"297.6818181818182\" x2=\"545.9652987797186\" y2=\"297.6818181818182\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"0.5\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"217.22727272727275\" x2=\"545.9652987797186\" y2=\"217.22727272727275\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"0.5\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"136.77272727272725\" x2=\"545.9652987797186\" y2=\"136.77272727272725\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"0.5\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"56.31818181818181\" x2=\"545.9652987797186\" y2=\"56.31818181818181\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"0.5\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"337.9090909090909\" x2=\"545.9652987797186\" y2=\"337.9090909090909\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"257.45454545454544\" x2=\"545.9652987797186\" y2=\"257.45454545454544\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"177.0\" x2=\"545.9652987797186\" y2=\"177.0\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"96.54545454545456\" x2=\"545.9652987797186\" y2=\"96.54545454545456\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"16.090909090909065\" x2=\"545.9652987797186\" y2=\"16.090909090909065\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" stroke-width=\"1.4\" fill=\"none\">\n", " </line>\n", " </g>\n", " </g>\n", " </g>\n", " <g clip-path=\"url(#cgDGq93)\" clip-bounds-jfx=\"[rect (27.034701220281416, 0.0), (545.9652987797186, 354.0)]\">\n", " <g transform=\"translate(27.034701220281416 0.0 ) \">\n", " <g>\n", " <g>\n", " <g>\n", " <g >\n", " <circle fill=\"#474747\" stroke=\"#474747\" stroke-opacity=\"0.0\" stroke-width=\"0.0\" cx=\"24.816604489987213\" cy=\"337.9090909090909\" r=\"5.5\" />\n", " <circle fill=\"#474747\" stroke=\"#474747\" stroke-opacity=\"0.0\" stroke-width=\"0.0\" cx=\"272.98264938985926\" cy=\"177.0\" r=\"5.5\" />\n", " <circle fill=\"#474747\" stroke=\"#474747\" stroke-opacity=\"0.0\" stroke-width=\"0.0\" cx=\"521.1486942897313\" cy=\"16.090909090909065\" r=\"5.5\" />\n", " </g>\n", " </g>\n", " </g>\n", " </g>\n", " </g>\n", " <defs>\n", " <clipPath id=\"cgDGq93\">\n", " <rect x=\"27.034701220281416\" y=\"0.0\" width=\"545.9652987797186\" height=\"354.0\">\n", " </rect>\n", " </clipPath>\n", " </defs>\n", " </g>\n", " <g>\n", " <g transform=\"translate(27.034701220281416 354.0 ) \">\n", " <g transform=\"translate(24.816604489987213 0.0 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"0.0\" y2=\"4.0\">\n", " </line>\n", " <g transform=\"translate(0.0 6.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-x\" text-anchor=\"middle\" dy=\"0.7em\">\n", " <tspan>1</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(148.89962693992325 0.0 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"0.0\" y2=\"4.0\">\n", " </line>\n", " <g transform=\"translate(0.0 6.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-x\" text-anchor=\"middle\" dy=\"0.7em\">\n", " <tspan>1.5</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(272.98264938985926 0.0 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"0.0\" y2=\"4.0\">\n", " </line>\n", " <g transform=\"translate(0.0 6.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-x\" text-anchor=\"middle\" dy=\"0.7em\">\n", " <tspan>2</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(397.0656718397953 0.0 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"0.0\" y2=\"4.0\">\n", " </line>\n", " <g transform=\"translate(0.0 6.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-x\" text-anchor=\"middle\" dy=\"0.7em\">\n", " <tspan>2.5</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(521.1486942897313 0.0 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"0.0\" y2=\"4.0\">\n", " </line>\n", " <g transform=\"translate(0.0 6.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-x\" text-anchor=\"middle\" dy=\"0.7em\">\n", " <tspan>3</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " </g>\n", " <g transform=\"translate(27.034701220281416 0.0 ) \">\n", " <g transform=\"translate(0.0 337.9090909090909 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"-4.0\" y2=\"0.0\">\n", " </line>\n", " <g transform=\"translate(-6.0 0.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-y\" text-anchor=\"end\" dy=\"0.35em\">\n", " <tspan>1</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(0.0 257.45454545454544 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"-4.0\" y2=\"0.0\">\n", " </line>\n", " <g transform=\"translate(-6.0 0.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-y\" text-anchor=\"end\" dy=\"0.35em\">\n", " <tspan>1.5</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(0.0 177.0 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"-4.0\" y2=\"0.0\">\n", " </line>\n", " <g transform=\"translate(-6.0 0.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-y\" text-anchor=\"end\" dy=\"0.35em\">\n", " <tspan>2</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(0.0 96.54545454545456 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"-4.0\" y2=\"0.0\">\n", " </line>\n", " <g transform=\"translate(-6.0 0.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-y\" text-anchor=\"end\" dy=\"0.35em\">\n", " <tspan>2.5</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(0.0 16.090909090909065 ) \">\n", " <line stroke-width=\"1.4\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"-4.0\" y2=\"0.0\">\n", " </line>\n", " <g transform=\"translate(-6.0 0.0 ) \">\n", " <text style=\"font-size:13.0px;\" y=\"0.0\" class=\"axis-text-y\" text-anchor=\"end\" dy=\"0.35em\">\n", " <tspan>3</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " </g>\n", " <rect x=\"27.034701220281416\" y=\"0.0\" height=\"354.0\" width=\"545.9652987797186\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" stroke-width=\"0.0\" fill-opacity=\"0.0\">\n", " </rect>\n", " </g>\n", " </g>\n", " <g transform=\"translate(15.0 183.0 ) rotate(-90.0 ) \">\n", " <text style=\"font-size:15.0px;\" y=\"0.0\" class=\"axis-title-y\" text-anchor=\"middle\">\n", " <tspan>y</tspan>\n", " </text>\n", " </g>\n", " <g transform=\"translate(321.01735061014074 394.0 ) \">\n", " <text style=\"font-size:15.0px;\" y=\"0.0\" class=\"axis-title-x\" text-anchor=\"middle\">\n", " <tspan>x</tspan>\n", " </text>\n", " </g>\n", " <path fill=\"rgb(0,0,0)\" fill-opacity=\"0.0\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" stroke-width=\"0.0\" d=\"M0.0 0.0 L0.0 400.0 L600.0 400.0 L600.0 0.0 Z\" pointer-events=\"none\">\n", " </path>\n", " </g>\n", " <g id=\"dw6VD0Z\">\n", " </g>\n", "</svg>\n", " <script>document.getElementById(\"af8c36f8-553a-49e1-a0b4-aff451714814\").style.display = \"none\";</script>" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "val dat = mapOf(\"x\" to listOf(1, 2, 3), \"y\" to listOf(1, 2, 3))\n", "letsPlot(dat) {x = \"x\"; y = \"y\"} + geomPoint(size = 5)" ] } ], "metadata": { "kernelspec": { "display_name": "Kotlin", "language": "kotlin", "name": "kotlin" }, "language_info": { "codemirror_mode": "text/x-kotlin", "file_extension": ".kt", "mimetype": "text/x-kotlin", "name": "kotlin", "nbconvert_exporter": "", "pygments_lexer": "kotlin", "version": "2.2.20-Beta2" } }, "nbformat": 4, "nbformat_minor": 5 }