geomPoint()
draws markers on a scatter plot using different colors, shapes and sizes of markers.
[Optional Table of Contents]
%useLatestDescriptors
%use lets-plot
LetsPlot.getInfo()
Lets-Plot Kotlin API v.4.4.1. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.3.2.0.
For demo, if possible, use standard data from lets-plot-docs repository.
For example:
%use dataframe
val df = DataFrame.readCSV("https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv")
df.head(3)
DataFrame: rowsCount = 3, columnsCount = 12
The 1-st figure is usually built with a minimal set of required parameters.
In many cases chapter header is not necessary.
letsPlot(df.toMap()) + geomPoint {
x = "displ"
y = "hwy"
}
color
and size
¶letsPlot(df.toMap()) + geomPoint {
x = "displ"
y = "hwy"
color = "drv"
size = "displ"
}
shape
¶letsPlot(df.toMap()) + geomPoint(size = 8) {
x = "displ"
y = "hwy"
shape = "drv"
}
letsPlot(df.toMap()) + geomPoint(size = 8) {
x = "displ"
y = "hwy"
shape = "drv"
} + scaleShape(
solid = false
)