A note on graphics



Hello,

> I looked at the examples of new plotting capabilities which you posted,
> > http://www.telefonica.net/web2/biomates/maxima/gpdraw
> 
> I have just some minor quibbles. On the whole it looks terrific to me.
> 
> (1) I'd prefer to rework plot2d instead of creating a separate
> function gpdraw2d.
> It would be a mess to have both old and new plotting functions.
> It would be OK with me to cut out plot2d, but if so I would rename
> gpdraw2d to draw2d or something else not specific to Gnuplot.
> 

The prefix gp is to make clear it's only a gnuplot interface.

> (2) I'd like to see a function which adds more stuff to an existing plot,
> let's say plot2d_more or something. That way the user need not think
> of everything before calling plot2d just once.
> 
> (3) I'd like to see a function which replots the most recent plot.
> E.g. if you close the plot window and then you want to see the
> same stuff again. Or you want the same stuff but output to a
> file instead of shown on the screen.
> 

These two points are related to interactivity. I add them to the todo
list, but maybe it's not a bad idea to wait for gnuplot 4.2 to fully
develope this part.


> (4) I think I'd like to see plotting functions return a description of
> the current plot, maybe as a noun expression 'plot2d(x, y, z, ...).
> At present plot2d returns an empty string; pretty much anything
> would be more useful.
> 

You can make use of objects gr2d and gr3d to store 2d and 3d scenes
respectively:

(%i3) scn4:gr3d(explicit(20*exp(-x^2-y^2)-10,x,0,2,y,-3,3),
         contour_levels = 15,
         contour        = both,
         surface_hide   = true,
         terminal       = eps_color) $
(%i4) args(scn4);
                        2    2
                     - y  - x
(%o4) [explicit(20 %e          - 10, x, 0, 2, y, - 3, 3),
contour_levels = 15, contour = both, surface_hide = true,
terminal = eps_color]
(%i5) gpdraw(scn4);
(%o5)                          false


Instead of false, gpdraw could return the input object (scn4 in this
case). Is that right?

Mario
-- 
Mario Rodriguez Riotorto
www.biomates.net