A simple gnuplot to generate labels as function of a particular column is here; also, is a function that can input a value and return a string:
set datafile separator ","
set datafile commentschar '#'
set key autotitle columnhead # use the first line as title for data
set key noenhanced
function $labellookup(x) << EOF
temp="null"
if(x==2000){
temp="two"
}
if(x==1000){
temp="one"
}
if(x==3000){
temp="three"}
return temp
EOF
set yrange[*:*]
$DATA << EOD
t, v1, v2
0, 10, 3000
10, 11, 1000
15, 10, 4000
30, 11, 5000
38, 20, 6000
46, 11, 8000
47, 30, 1000
48, 31, 1000
49, 30, 4000
50, 31, 6000
51, 30, 9000
52, 30, 2000
61, 21, 3000
65, 20, 3000
70, 21, 4000
75, 10, 5000
EOD
# use column 1, and column 3 is the label; values
# are (x,y)=(column1, 2)
# column 2 is ignored
plot $DATA using 1:(2):3 with labels rotate by 90 left
When the above is run, the third column is the label as shown. How can the function be used to set the labels as the defined strings, so (for example) instead of seeing "3000" we see "three" in the plot?



1000-->"one",2000-->"two", ... until9000-->"nine"or are there more numbers and relations?