%useLatestDescriptors
%use lets-plot
LetsPlot.getInfo()
Lets-Plot Kotlin API v.4.2.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.3.0.0.
%use krangl
val iris = DataFrame.readCSV("https://raw.githubusercontent.com/JetBrains/lets-plot-kotlin/master/docs/examples/data/iris.csv")
iris.head()
sepal_length | sepal_width | petal_length | petal_width | species |
---|---|---|---|---|
5.1 | 3.5 | 1.4 | 0.2 | setosa |
4.9 | 3.0 | 1.4 | 0.2 | setosa |
4.7 | 3.2 | 1.3 | 0.2 | setosa |
4.6 | 3.1 | 1.5 | 0.2 | setosa |
5.0 | 3.6 | 1.4 | 0.2 | setosa |
Shape: 5 x 5.
val p = letsPlot(iris.toMap()) { x = "species"; y = "sepal_length" }
p + geomViolin() + ggtitle("Basic demo")
p + geomViolin(showHalf = -1) { fill = "species" } +
geomViolin(showHalf = 1, fill = "#ffffb2") +
ggtitle("half violins")