Skip to content
Scala Plotting Library
Scala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs/docs
project
src
.gitignore
.travis.yml
EXAMPLE.md
LICENSE
README.md
ROADMAP.md
build.sbt
splot-logo.png

README.md

SPlot Logo

Scala 2D Plotting library.

Build Status codecov.io License

Version: 0.4.0-SNAPSHOT

Documentation for latest release version (0.4.0) is available at splot-web.github.io.

SPlot is a poor-man replacement of matplotlib Python library for Scala.

Current version of this library is available on maven central at these coordinates

libraryDependencies += "xyz.devfortress.splot" % "splot-core_2.12" % "0.4.0"

It can plot line plots, scatter plots, arbitrary closed polygons, heatmap plots etc.

To try it out type following into your Ammonite-REPL

import $ivy.`xyz.devfortress.splot::splot-core:0.4.0`, xyz.devfortress.splot._
import Math._
import java.util.Random

def f(x: Double)(implicit rnd: Random): Double =
  (rnd.nextDouble * 0.3  + 1) * sin(x + 0.1 * (rnd.nextDouble - 0.5))

val fig = new Figure(
  title = "Periodic signal with random phase shift and amplitude",
  xLabel = "t - time",
  yLabel = "Signal Level",
  showGrid = true
)

implicit val rnd = new Random
val data = (0.0 to 20 by 0.1).map(x => (x, f(x)))

fig.plot(data, lw = 2, color = "blue")
fig.show(800, 600)
You can’t perform that action at this time.