Axis And Legend Configuration
val df =
DataFrame.readCSV("https://raw.githubusercontent.com/JetBrains/lets-plot-kotlin/master/docs/examples/data/mpg.csv")
df.plot {
points {
x("displ") {
axis.name = "engine displacement, liters"
}
y("hwy") {
axis {
name = "highway mileage, mpg"
breaks(listOf(15, 25, 35, 45), format = "d")
}
}
color("cty") {
legend {
name = "city mileage"
breaks(format = "{d} mpg")
}
}
symbol("drv") {
legend {
type = LegendType.DiscreteLegend(nRow = 2)
name = "drive type"
breaksLabeled("4" to "4WD", "r" to "RWD", "f" to "FWD")
}
}
size = 4.0
}
}
Last modified: 30 November 2023