import $ivy.`org.plotly-scala::plotly-almond:0.7.0` import plotly._ import plotly.element._ import plotly.layout._ import plotly.Almond._ new java.io.File("/Users/alexandre/projects/Ammonite") .listFiles() .toSeq .filter(_.getName.startsWith("results-")) .filter(_.getName.endsWith(".txt")) .sortBy(_.toString) .map { f => val values = new String(java.nio.file.Files.readAllBytes(f.toPath), "UTF-8").split("\n") .map(_.trim) .filter(_.nonEmpty) .drop(5) .map(_.toLong) Box(x = values.toSeq, name = f.getName.stripPrefix("results-").stripSuffix(".txt")) } .plot( xaxis = Axis(range = (0.0, 1500.0)) ) // as PNG Image.fromFile("/Users/alexandre/projects/Ammonite/newplot.png")