I have a single column file from an oscilloscope that reads voltage versus sample number and I'm wanting to plot the trace in gnuplot and label the two maxima in my signal. The first one is easily found from GPVAL_DATA_Y_MAX, as shown here:
set term png 1 small
set output "~/path/to/outputfile.png"
max_y = GPVAL_DATA_Y_MAX
set label 1 gprintf("Max = %g", max_y) at x, y
plot "~/path/to/myfile" w lines lt rgb "black"
This is a snippet of a larger macro that I've written to plot multiple traces from multiple files simultaneously. I can label my first maximum no sweat, but I can't seem to sort out a good method for labeling the second peak in my data.
statstwice with different ranges. In any cases you should use that command to extract values from data. If you don't know the approximate range where the maxima appear you should use e.g. a python script for the calculations.pos = system("python myscript.py");and you continue with the values inpos.