{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "electronic-ownership", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%useLatestDescriptors\n", "%use lets-plot\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "invalid-piece", "metadata": {}, "outputs": [], "source": [ "val dat = mapOf(\"x\" to -32..32) \n", "\n", "val p = letsPlot(dat) + coordCartesian() + ggsize(600, 200)" ] }, { "cell_type": "code", "execution_count": 3, "id": "caring-overhead", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p + geomTile {x = \"x\"; fill = \"x\"} + \n", " scaleFillGradientN(colors = listOf(\"#2b83ba\", \"green\", \"#d7191c\"))" ] }, { "cell_type": "code", "execution_count": 4, "id": "specialized-airfare", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p + geomTile(fill = \"white\", size = 2) {x = \"x\"; color = \"x\"} + \n", " scaleColorGradientN(colors = listOf(\"#2b83ba\", \"green\", \"#d7191c\"))" ] }, { "cell_type": "code", "execution_count": 5, "id": "tracked-integral", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p + geomTile {x = \"x\"; fill = \"x\"} + \n", " scaleFillGradientN(colors = listOf(\"red\", \"orange\", \"yellow\", \"green\", \"light_blue\", \"blue\", \"magenta\"))" ] }, { "cell_type": "code", "execution_count": 6, "id": "received-villa", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Asymmetric gradient\n", "p + geomTile {x = \"x\"; fill = \"x\"} + \n", " scaleFillGradientN(colors = listOf(\"#2b83ba\", \"#2b83ba\", \"#2b83ba\", \"#2b83ba\", \"green\", \"#d7191c\"))\n", " " ] } ], "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": "1.7.20-dev-1299" } }, "nbformat": 4, "nbformat_minor": 5 }