kandy 0.7.0 Help

Export to File

// Create random density data val rand = java.util.Random(42) val n = 500 val dataset = dataFrameOf( "rating" to List(n / 2) { rand.nextGaussian() } + List(n / 2) { rand.nextGaussian() * 1.5 + 1.5 }, "cond" to List(n / 2) { "A" } + List(n / 2) { "B" } )
// Density plot val myPlot = plot(dataset) { groupBy(cond) { densityPlot(rating, trim = true) { fillColor = Color.GREY alpha = 0.6 borderLine.color("cond") } } } myPlot
Guide export density plot

Export PNG to file

val pathPNG = myPlot.save("myDensity.png")
javax.imageio.ImageIO.read(File(pathPNG))
Guide export density plot

Export SVG to file

val pathSVG = myPlot.save("myDensity.svg")
HTML(File(pathSVG).readText())
Guide export density plot

Export HTML to file

val pathHTML = myPlot.save("myDensity.html")
HTML(File(pathHTML).readText())
Guide export density plot
Last modified: 07 December 2023