|
From: Ethan M. <merritt@u.washington.edu> - 2009-11-11 16:35:59
|
On Wednesday 11 November 2009, Tait wrote: > > > stats 'foo' u ($2*$3+cos($4)) should work as it is, if that is what you meant. A > > fairly large set of quantities can be calculated using the variables that are > > produced by stats, if the proper function is applied to the columns beforehand. > > That is not at all what I meant. The stats command (and plot, and others) > provide access to other data values on the same row, via $column-number. > There is, however, no way to access values on _other_ rows. I can't plot > the delta between the current $2 and the $2 of the previous row, for > example. A general way to provide formulas or expressions that operate > across multiple rows would be more flexible and also make "stats" > unnecessary. You can do this while plotting. See "running_avg.dem". Whether it's worth making the syntax of the stats command more like the plot command, that's another question. Or for that matter, whether it's better to have a separate stats command or to incorporate it into the existing plot command. > The tangent about Perl was intended to be in the same vein as Ethan's > comment that gnuplot is not MatLab or Mathematica or MathCad or R, and > we shouldn't try to be. The wasn't me. I think it's silly to rule out a useful addition on that basis. I think we should seriously consider any addition that strengthens gnuplot's ability to create plots. I do want to hear a strong case, however, that the stats command needs to be an internal part of gnuplot rather than an external script. I currently do this sort of thing in an external perl script (or in R). But using R to calculate the min/mean/max is ridiculous overkill, and I'd still have to get the information back into gnuplot in order to generate the plots. > Maybe an alternate (and more useful?) way to provide the stats > functionality is to add a contrib directory to the gnuplot > distribution in which are placed stand-alone utilities like stats > that perform useful transformations on and summaries of > gnuplot-looking data files, using gnuplot-looking syntaxes. Exactly. I'm not 100% convinced that the initial set of capabilities in the "stats" command justifies including it in the core code rather than just running an external script. But if further integration with the plotting code gives additional benefits over running an external script, so be it. |