|
From: <pl...@pi...> - 2011-09-30 20:39:56
|
Hi, I am calling a simple function max() to detect the two largest peaks in the data. #function to do sample/hold max(x,y)=(ymax<y) ? ( xmax=x, ymax=y) :ymax ; # dummy plot to scan data for biggest peak set term unknown plot ymax=xmax=0, datafile using 1:( max(($1),($2)) ); pk0=xmax; ymax=xmax=0; plot [pk0+100:] datafile using 1:( max(($1),($2)) ); pk1=xmax; set term '' if (debugging) print "xmax = ",xmax,"; ymax ",ymax; pause mouse It's hitting the first one both times. Now unless I'm getting sleepy, this seems to show that the second call to plot with a specified limited range is still going through the motions. and evaluating the using clause for all data points in the file. Thus all the mechanics are still being gone through only to have null output created. Is this : ? a) correctly what's happening b) necessary c) desirable. ? If I have a huge data file (that I do sometimes.) it would seem advantageous if setting a range pre-empted the rest of plot activity until the range condition is true. Best regards. Peter. |