[kepler-dev] 2d display widget?

Tobin Fricke tobin at splorg.org
Wed Jul 28 16:29:06 PDT 2004


On Wed, 28 Jul 2004, Edward A Lee wrote:

> If you want to take this on, I strongly recommend looking at Matlab for
> inspiration...  Alternatively, you can just use the MatlabExpression
> actor... The Matlab demo in the quick tour generates a beautiful 4-D
> plot (3-D + time) of moving waves...

I suppose that would work, but external dependencies (on expensive
software) are kind of a downer...  although I am completely in favor of
'borrowing' ideas from Matlab (an extraordinarily well-engineered bit of
software, IMO).

I am playing with using gnuplot in this capacity, since gnuplot supports
all kinds of jazzy plot formats, including various types of surface plots,
is free, and runs on anything.  There are a few screenshots at
http://wwww.gnuplot.info/ .  Exporting to postscript is another bonus for
the possibility of use in publications.

A first go was to use the org.sdm.spa.CommandLine actor to call gnuplot
with the following command line:

	echo "sin(x)" | gnuplot

I'm a bit confused by the infileHandle port on CommandLine -- is it just a
URL-or-filename?  Is there a way to support input redirection? i.e.,
possibly to have the CommandLine actor start the cmdline process on
initialize() and feed.

Or would it be worth creating a distinct gnuplot actor?  Or maybe a
UnixProcess actor could have these other (persistent process connected to
Ptolemy via standard i/o) semantics.

Another possibility is to have an actor that generates a FIFO (using
mkfifo) or a temporary file (using mktemp) and (1) sends any input tokens
to the standard input of this file/fifo, and (2) forwards the filename of
the file/fifo as output, to be used, for instance with CommandLine.  This
is an instance of the 'third party problem', with the unix filesystem
providing a namespace.  Seems hackish to me.

> We did have a MatrixToImage actor at some point, but it was not well
> written, and it was hard to use to get good images.

Being sort of lazy, my approach would be to take a Matrix, feed it through
a Colormap, and produce an ImageToken.  This would lack many of the Matlab
niceities but get the job done, I think.

Tobin




More information about the Kepler-dev mailing list