Q:

Graph with Gnuplot of statistic with different three different input data

I am plotting the frequency of the data sampling in an interval. The code is:
n=50 #number of intervals

plot "xxx.csv" u ($0):1 #To get the max and min value
max=GPVAL_Y_MAX
min=GPVAL_Y_MIN
width=(max-min)/n #interval width

#function used to map a value to the intervals
hist(x,width)=width*floor(x/width)
set ytic auto  
set xtic auto
plot    "xxx.csv" u (hist($1,width)):(1.0) smooth freq w histeps ls 1 title "xxx"

This works, but I would like to put two similar graph overlapped with different data. The problem is that the data are different so max, min and width are not the same. The data are separated files like yyy.csv and zzz.csv. How can I do this? 

A:

Do you have gnuplot >= 4.6? If so you can use the stats command to get statistics for those files easily, otherwise it would probably be a matter of doing what you did in your script (plot, then use GPVAL_Y_MIN, etc.) and create a set of variables for each data set.
(Posting my earlier comment as an answer.)

