The following code (From https://plot.ly/scala/3d-surface-plots/ ) Does not work on Scala 2.11
(Just built the jar from https://github.com/asidatascience/scala-plotly-client )
The basic scatter plot from (https://plot.ly/scala/line-and-scatter/#simple-scatter-plot) does compile and run fine.
I get
Exception in thread “main” java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method) …
At run time.
import co.theasi.plotly._
import co.theasi.plotly.ThreeDPlot
object VizTest {
def main(args: Array[String]): Unit = {
surface()
}
def surface(): Unit = {
val xs = (-3.0 to 3.0 by 0.1).toVector
val ys = (-3.0 to 3.0 by 0.1).toVector
def gaussian2D(x: Double, y: Double) = Math.exp(-x*x - y*y)
val zs = xs.map { x => ys.map { y => gaussian2D(x, y) } }
val p = ThreeDPlot().withSurface(xs, ys, zs)
draw(p, "gaussian-surfaces",writer.FileOptions(overwrite=true))
}
}