https://kotlinlang.org logo
Title
l

lovis

04/24/2020, 2:27 PM
Hi everyone, this is probably not really the right place to ask, as it’s more a lets-plot question. but since I’m using lets-plot-kotlin I’m just asking here: how can I configure the axis of a plot? I’ve got 5000 points, but I don’t want to have 5000 entries on the y-axis 😅 (step size 1000 is enough) Can anybody point me in the right direction? I’ve already checked https://nbviewer.jupyter.org/github/JetBrains/lets-plot/blob/master/docs/examples/jupyter-notebooks/legend_and_axis.ipynb but couldn’t find something useful. Thanks a lot!
i

Igor Alshannikov

04/24/2020, 4:16 PM
Hi, if the values are continuous (numeric) then Lets-Plot is supposed to choose an appropriate step size automatically, but if the values are discrete (like strings) then all of them are shown. I understand you have the latter?
l

lovis

04/24/2020, 4:47 PM
oh wow that was a simple solution… thanks a lot! 😄
👍 1
now it also makes sense, why the y-axis was “inversed” - because y-values were strings and therefore it didn’t compare as I expected 🙂🤦‍♂️
Another thing: Am I correct that
xlab
etc. are not yet available in lets-plot-kotlin? is there a workaround?
i

Igor Alshannikov

04/24/2020, 5:37 PM
Unfortunately they are not but I can add
xlab
ylab
really quick. So far Lets-Plot Kotlin API is a small subset of the original
ggplot2
API and if you miss somethink don't hetitate to submit an issue : https://github.com/JetBrains/lets-plot-kotlin/issues 🙂
👍 1