{ "cells": [ { "cell_type": "markdown", "id": "normal-allowance", "metadata": {}, "source": [ "### Violin Geometry" ] }, { "cell_type": "code", "execution_count": 1, "id": "optical-digit", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
DataFrame: rowsCount = 5, columnsCount = 12
\n", " \n", " \n", " " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "var mpg = DataFrame.readCSV(\"https://raw.githubusercontent.com/JetBrains/lets-plot-kotlin/master/docs/examples/data/mpg.csv\")\n", "mpg.head()" ] }, { "cell_type": "code", "execution_count": 4, "id": "variable-delta", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "letsPlot(mpg.toMap()) + geomViolin { y = \"hwy\" }" ] }, { "cell_type": "markdown", "id": "prepared-jacksonville", "metadata": {}, "source": [ "### `geomViolin()` and `geomDesity()`" ] }, { "cell_type": "code", "execution_count": 5, "id": "compliant-bridges", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "org.jetbrains.letsPlot.intern.figure.SubPlotsFigure@2715644a" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "val densityPlot = letsPlot(mpg.toMap()) + \n", " geomDensity(color=\"black\", alpha=.5) {x=\"hwy\"; fill=\"drv\"} + \n", " facetGrid(x=\"drv\") + \n", " coordFlip() + scaleYContinuous(breaks = emptyList