I am reading data from a file, and I determine the min and the max.
I would like to implement a function where if min==max, then min = 0
I have thios so far:
reset
# Define two helper functions
ismin(x) = (x<min)?min=x:0
ismax(x) = (x>max)?max=x:0
# Initialise the 'global' vars
max=-1e38
min=1e38
plot "Data.txt" u 0:(ismin($3)*ismax($3))
#set terminal windows
set terminal png medium size 900,600
set output "Data.png"
print min
print max
iseq(min,max) = (min == max)?min = 0 :0
print min
print max
How can I set min to 0 if min==max?
Thank you