This page is no longer maintained — Please continue to the home page at www.scala-lang.org

VISAD Matlab-like interface for ScalaLab

No replies
sterg
Joined: 2009-10-06,
User offline. Last seen 2 years 39 weeks ago.

Hi,

I think that the VISAD data visualization library is the most complete
open-source Java scientific plotting library for Java
(.. of course I cannot be sure on that!)

However, VISAD is relatively difficult in its plain interface.
Therefore, I started to work on an easy to use Matlab-like interface for
ScalaLab and I'm happy to announce that I have a "preview" workable
version in the current scalalab281.zip
(.. however many other routines remain to interfaced, especially 3-D
plots)

For example we can execute the following code:

//demonstrate Matlab-like plotting using VISAD

val t=inc(0, 0.01, 10); val x = sin(3.4*t)
val y = sin(4.8*t)
val z = x+0.2*y

vfigure(2);
vsubplot(2, 2, 1); vplot(x, 8); // plot with 8 point line
vsubplot(2, 2, 2); vplot(x)
vsubplot(2, 2, 3); vplot3
val zz = z+cos(0.8*z)
vsubplot(2, 2, 4); vplot(z);
vaddplot(zz) // add the plot without erasing previous, i.e. in
"hold on" state
val zzz = zz+ sin(3.4*zz)
vaddplot(zzz, "zzx", "zzy", 5)

vfigure(3);
vsubplot(2, 2, 1); vplotPoint(x); // plot with 8 point line
vsubplot(2, 2, 2); vplot(x)
vsubplot(2, 2, 3); vplotXYPoints(x, y, "x", "y", 8)
vsubplot(2, 2, 4); vplot(z)
vaddplot(zz) // add the plot without erasing previous, i.e. in
"hold on" state
vaddplot(zzz, "zzx", "zzy", 5)

Regards

Stergios

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland