From: Jon G. <jo...@th...> - 2014-04-24 15:47:52
|
> > One feature I've been missing from gnuplot is the ability to normalise a > > dataset; that is, scale all values so that they are in [0:1] by dividing > > by the maximum value. The attached patch does so by introducing "smooth > > normal". > > The usual thing to do to "normalise" data would be subtract the mean and > divide by std dev. The reason I want to divide by the max here is that I want to ensure the plot will always fit within the range I specify. "Proper" normalization wouldn't do that. In particular, this is useful for live plots where the shape of the data may change drastically from one plot to the next. > I think the design philosophy here has been that most data processing is > well catered for elsewhere and GP is not trying to be kitchensink, one > stop , DP and plotting tool. I agree. I do feel that some commonly used functions should be included though, to prevent the need for external tools for common tasks. I admit normalization (or variations thereof) might not fall into that category though. > However, if you want to do this sort of thing it does not require a > patch to gnuplot, just use a function. > > max(x) =(if (x>biggest)?biggest=max:(x)) > biggest=-1e-134; plot datafile 1:max($2) > plot datafile 1:($2/biggest) Ah, of course, why didn't I think of that?! Thanks, I'll use this instead. Jon |