%useLatestDescriptors %use lets-plot //%use krangl LetsPlot.getInfo() // Work around Krangl loading old Lets-Plot classes. %use krangl val df = DataFrame.readCSV("https://raw.githubusercontent.com/JetBrains/lets-plot-kotlin/master/docs/examples/data/mpg.csv") df.head(3) val p = letsPlot(df.toMap()) { x = "cty"; y = "hwy"; color = "drv" } + geomPoint(tooltips = layerTooltips() .title("@manufacturer @model") .line("@|@class") .line("@|@year")) + labs( title = "The plot title", subtitle = "The plot subtitle", caption = "The plot caption", color = "Drive type" ) p // Font size and face. val p1 = p + theme( title = elementText(size=18), plotTitle = elementText(face="bold"), plotCaption = elementText(size=12, face="italic"), axisText = elementText(size=14, face="italic"), tooltipText = elementText(size=15) ) p1 // Font family. p1 + theme(text = elementText(family="Times New Roman"))