From: <pl...@pi...> - 2007-05-03 13:57:40
|
Hi, I have been trying to trick gnuplot into doing some simple tasks it does= = not seem possible to do but which could be immensely useful. to judge by comp.graphics.apps.gnuplot it seems that there are certain = basic tasks that are frequently requested and get a reply along the line= s = of "gnuplot is not for number crunching". Fine. Gnuplot is a plotting program, not a data processing package but = there are an number of trivial tasks like calculating a mean or finding = = the max of values *calculated* by gnuplot that cant currently be done. Tasks like this are far less complex than function fitting do data or = plotting with spline interpolation and would be very valuable in the = context of outputting data to a graph. eg how to put a label at the max point of the data. Definately a plottin= g = task and hardly "number crunching" but currently it seems I have do this= = simple task in an external script. Worse, if I do some fitting and expression evaluation in the plot comman= d = , I have to duplicate it all to a table, call an external script and the= n = read in a new file to get the value of the max or mean value of y. all I really need is a means to assign one tiny little variable during = plot (directly or from a within a fn ) consider the following that will plot a "sample and hold": xmax=3D0; max(x)=3D( (xmax<x)?(xmax=3Dx):xmax ); plot "150tank-txC.data" using 1:(Th6($4)) with lines t "panel out" \ , "150tank-txC.data" using 1:(max(Th6($4))) with lines t "s/h" ; Currently not possible since function parser will not allow C style = 'assignment returns a value'. A similar technique could find the min , max, mean or area under graph; = in = fact it opens a whole range of possibilities that are frequently request= ed = on the list. So how much effort is it? Well without going to the extent of supporting procedure calls from with= = plot command , adding the above parsing of C style assignments would be = = simple to add and open the door to some very useful techniques. I hope you will find it worth considering. Kind regards. |