{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "impressive-meeting", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "DataFrame: rowsCount = 3, columnsCount = 12
\n", " \n", " \n", " " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "val df = DataFrame.readCSV(\"https://raw.githubusercontent.com/JetBrains/lets-plot-kotlin/master/docs/examples/data/mpg.csv\")\n", "df.head(3)\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "reasonable-baltimore", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "val p = letsPlot(df.toMap()) { x = \"cty\"; y = \"hwy\"; color = \"drv\" } + geomPoint() + labs(color=\"Drive type\") \n", "p" ] }, { "cell_type": "code", "execution_count": 5, "id": "smooth-willow", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "// Horizontal justification for plot title, subtitle, caption, legend and axis titles\n", "\n", "val hjustLeft = elementText(hjust = 0.0)\n", "val hjustMiddle = elementText(hjust = 0.5)\n", "val hjustRight = elementText(hjust = 1.0)\n", "\n", "\n", "fun withHJjust(hjust: Map