问题
I have the following data file for gnuplot
1 0.5 0.9
2 -0.1 0.5
3 0.7 0.4
where the first column is x-axis, and 2,3 columns are two different graphs. Coordinates of x-axis are always natural numbers, they represent the location of the word in sentence, 2 and 3 columns is just the result of function on the word in sentence.
I wonder if it's possible to label "1", "2" ,... on the x-axis with words from sentence.
If I would have
1 A 0.5 0.9
2 green -0.1 0.5
3 apple 0.7 0.4
ans then in stead of 1,2,3 I would have "A" "green" "apple".
Please let me know if it's possible to do with gnuplot.
回答1:
Use xticlabels to select a column for your custom labels:
plot 'file' using 1:3:xticlabels(2)
来源:https://stackoverflow.com/questions/22821701/gnuplot-arbitrary-labeling-x-axis