[CM] new plotting utility

Heinrich Taube taube at uiuc.edu
Sat Jun 20 05:32:30 PDT 2009


svn trunk has a new plotting facility that includes a scheme api   
similar to the (gnuplot ...) function in CM2. the new plotter window  
is much improved and simplified (it now looks bascially like the x- 
windows gui i had in cm2...)

main points:

Plot windows can display/edit multiple layers of points, each with  
their own color and style.
Points can have more than 2 fields of data (ie arities greater than 2 )
Plots can be saved to disk.  Plot files store contents in XML data so  
you can edit these too.
WIndow: Control-click adds points, Delete key delete points, Click- 
Drag on axis to zoom
Scheme:
  The (plot ...) function opens a new window with data you pass to it
  The (plot-data ...)  function returns data from an open plot window  
back to scheme
Documentation is in:  cm/res/doc/cm.html#plotting

Example
Lisp:

(plot :title "Hi Ho!"  '(0 0 .25 1 .75 1 1 0) '(0 0 1 1))

XML:

<plot title="Hi Ho!>
  <axis name="x" range=" 0 1 0.25 5"/>
  <axis name="y" range=" 0 1 0.25 5"/>
  <points title="Layer 1" style="lineandpoint"  
color="ffff0000"><point>0.00 0.00</point><point>0.25 1.00</ 
point><point>0.75 1.00</point><point>1.00 0.00</point></points>
  <points title="Layer 2" style="lineandpoint"  
color="ff008000"><point>0.00 0.00</point><point>1.00 1.00</point></ 
points>
</plot>


the easiest way to see how it works is to try out the new examples in  
the Help menu:  Help>Examples>Plotting

todo next weeks: sonification of point sets, axis and layer  
customization dialogs


I plan on making a major binary release of CM3 in about two weeks  
including support for the new C version of Fomus that David Psenicka  
has been working on the past year.






More information about the Cmdist mailing list