El mar, 19-09-2006 a las 14:57 -0700, Richard Fateman escribi?:
> There is a specification for graphics and for plotting in Mathematica.
> My understanding is that the plotting program produces a graphics object
> (based on the function(s) being plotted as well as parameters,) and the
> display program produces a pretty picture (based on the graphics object as
> well as additional parameters).
>
> Looking at Mathematica's design might be helpful, seeing as how you seem
> to be coming up with something similar, anyway. Maybe you can avoid some
> pitfalls.
>
> RJF
>
You have read my mind :)
In fact, I was thinking in Mathematica when I wrote my previous posts.
The idea is to have a list of graphical objects, from simple (points,
circles, rectangles, labels, arrows, etc.) to complex (functions in 2d
and 3d, bitmaps, Chernoff faces, etc.), each depending on parameters
(position, color, thickness, etc.). Now, once I pack them under the
header 'scene', I pass them to the 'plot' function.
Furthermore, if I pack a set of objects of type 'scene' under header
'movie', function 'plot' should generate an animation. And if I pack
them under header 'multiplot', function 'plot' should divide the
plotting region in order to draw the scenes in different subregions of
the same window.
I have written a toy package to illustrate the basic idea:
/******* begin Maxima session **********/
(%i1) load("~/proyectos/plot/paint.lisp");
(%o1) ~/proyectos/plot/paint.lisp
(%i2) scene(point(3,5), point(6,7,colorpoint=red));
(%o2) scene(point(3.0, 5.0, colorpoint = black,
stylepoint = circle, sizepoint = 0.2),
point(6.0, 7.0, colorpoint = red, stylepoint = circle,
sizepoint = 0.2))
(%i3) plot(%, with=gnuplot);
(%o3) Let's go
/******** end Maxima session **********/
"Let's go" is the only output I get from 'plot', since I didn't write
the gnuplot interface yet. In its present state, the package only
recognices objects of type 'point' (it's the very beginning).
For object point, the coordinates are mandatory, but colorpoint,
stylepoint and sizepoint are options, with defaults black, circle, and
0.2, respectively.
To get a more descriptive output in %o2, we could set a nice display
property for scene (not me, I have real difficulties to understand
displa.lisp).
I'm thinking aloud, and I'm sure things will be harder once we get into
details.
--
Mario Rodriguez Riotorto
www.biomates.net