Hello everyone, Im new both to kotlin and slack, I...
# datascience
a
Hello everyone, Im new both to kotlin and slack, I was experimenting with the kt jupyter notebook kernel and I was wondering 1. Is it possible to download the plots I create as images? 2. Im using lets-plot but the documentation link seems to be dead, Is there a way to hide some of the values of one of the two axis to make its values readable? I have way too many entries on my data set and the labels get overlayed and become unreadable
i
Hi, answering your question 1: At the moment there is only export to SVG and HTML available. To export to SVG:
Copy code
import jetbrains.datalore.plot.PlotSvgExport
import jetbrains.letsPlot.intern.toSpec

val p = lets_plot(..) + ..

val spec = p.toSpec()
val str = PlotSvgExport.buildSvgImageFromRawSpecs(spec)
To export to HTML:
Copy code
import jetbrains.datalore.plot.PlotHtmlExport
import jetbrains.letsPlot.intern.toSpec

val p = lets_plot(..) + ..

val spec = p.toSpec()
val str = PlotHtmlExport.buildHtmlFromRawSpecs(spec, iFrame = true)
There are exmples of this in Lets-PLot Kotlin repo: https://github.com/JetBrains/lets-plot-kotlin/blob/master/demo/browser/src/main/kotlin/exportSvgDemo/SinglePlotSvg.kt https://github.com/JetBrains/lets-plot-kotlin/blob/master/demo/browser/src/main/kotlin/exportHtmlDemo/SinglePlotHtml.kt
👍 1
2) Sometimes axis labels become messy when the intention was to map a continuous (numeric) variable to X or Y axis but values in the mapped data series are only look as numbers but are actually strings. If that is your case you will have to convert these strings to numbers before passing them to plot.
👍 1
Thanx for feedback, please fill free to post any questions/issues here: https://github.com/JetBrains/lets-plot-kotlin/issues
👍 1