{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "material-professor", "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": "going-administration", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// default theme\n", "val dat = mapOf(\"x\" to 0..4, \"y\" to 0..4)\n", "val p = letsPlot(dat) +\n", " geomPoint(tooltips = layerTooltips().title(\"TITLE\").line(\"label|value\")) {\n", " x = \"x\"\n", " y = \"y\"\n", " size = \"y\"\n", " color = \"y\"\n", " } +\n", " labs(title = \"The plot title\", \n", " subtitle = \"The plot subtitle\",\n", " caption = \"The plot caption\",\n", " x = \"X axis title\", \n", " y = \"Y axis title\", \n", " color = \"Color legend title\",\n", " size = \"Size legend title\"\n", " )\n", "p" ] }, { "cell_type": "code", "execution_count": 3, "id": "olympic-michael", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Change the font face property of some elements.\n", "\n", "p + theme(\n", " plotTitle = elementText(face = \"italic\"), \n", " plotSubtitle = elementText(face = \"bold_italic\"),\n", " plotCaption = elementText(face = \"italic\"),\n", " \n", " legendTitle = elementText(face = \"bold\"),\n", " legendText = elementText(face = \"italic\"),\n", " \n", " axisTitle = elementText(face = \"bold\"),\n", " axisText = elementText(face = \"bold_italic\"),\n", "\n", " // The 'tooltipText' value will also applied to axes tooltips ('italic');\n", " // title and label in general tooltip are bold by default -> the result for them is 'bold_italic' \n", " tooltipText = elementText(face = \"italic\"))\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 }