From: Ethan A M. <sf...@us...> - 2014-04-28 16:48:10
|
On Monday, 28 April, 2014 11:59:27 Jon Gjengset wrote: > > >> 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?! > > > > Thats also somthing which can be done with the stats command: > > > > stats datafile using 2 > > plot datafile using 1:($2/STATS_max) > > Actually, there is one use-case not covered by these approaches, and > that is when doing a "live" plot where replot is called repeatedly and > the underlying datafile changes. In these situations (unless I'm > mistaken), STATS_MAX/biggest won't be recomputed, and so the scaling > will be incorrect. A smoothing filter would continue to work in this > case. Any thoughts on how rescaling on replot might be achieved without > a patch? Not precisely what you ask for, but very close to it set autoscale noextend set yrange [0:1] set ytics .1 set datafile volatile plot FOO axes x1y2 with line set y2range[GPVAL_DATA_Y2_MIN:GPVAL_DATA_Y2_DATA_MAX] refresh pause -1 This doesn't actually rescale the data, but it maps the values against the range [0:1] along the y axis. There would be a flash of data using the previous scale before the "refresh" remaps and redraws it. Ethan |