[PYTHON MATRIX-SIG] Plotting packages

Steven D. Majewski sdm7g@virginia.edu
9 Mar 97 18:12:41 -0500



Re: OO vs Functional:

	As another example, XlispStat has plot objects -- scatterplot-proto is
the basic 2d plot object, and spin-plot-proto is the basic 3d object. It 
also has some basic functions: plot-points, plot-lines, plot-function -
that
call scatterplot-proto's :NEW method, and return a plot object, which can
be further manipulated. ( and :NEW typically takes optional keyword args 
with other parameters. ) 
	The one problem with this scheme is that those generic functions all
create scatterplot-proto instances. This limits the ability to customize
the default behaviour of graphs.  You are forced to make changes to 
scatterplot-proto, rather than deriving new classes from it. 
	I would suggest that an extra layer of abstraction or indirection 
is needed. The generic functions should create an instance of 
"USER-PLOT-PROTO" (or whatever it's named) which by default is assigned
to another basic plot object type, but can be redefined to a new class. 


Re: S graphics vs XlispStat 

	I did quite a bit of evaluation of S++, XLispStat, and some other
math/plotting packages before I ended up choosing XlispStat for a project.
What it has that S++ doesn't is a more interactive idea of grapical objects
-- 
it's not just for producing graphical *output*, but graphical objects which
can be manipulated, sometimes with data points in one graph being linked
to data points in another graph. Some of the papers and packages on 
www.stat.ucla.edu are about "manipulating the regression line" - i.e. doing
some grapical "what-if" modeling. I'ld say XlispStat graphics are a much
better model to emulate than S. 

	This is a good realm for all you pattern enthusiasts. The major complaint
I have with XlispStat's graphics is that it's a bit too ad-hoc A network of
interactive plot and control and data objects can easily lead you into the
"spagetti objects" problem. This is what the discipline of patterns in
design
is meant to avoid.
	Python's multiple inheritance makes it possible to implement some basic
common functionality as Mixin's. ( In my xlispstat code, I've tried to use
some basic mixin's like stateful-proto ( things that have NORMAL, SELECTED,
INVISIBLE states and behaviour ) and xlinkable-proto ( things that can be
linked to other objects and broadcast their state changes. ) to simplify
some of this common behaviour of plots and plot-objects. 

- Steve Majewski 
 <sdm7g@Virginia.EDU> 
 <http://galen.med.virginia.edu/~sdm7g/> 








_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________