- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
VISAD Matlab-like interface for ScalaLab
Thu, 2011-04-14, 14:51
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