gnuplot任意标记x-轴 [英] gnuplot arbitrary labeling x - axis
问题描述
我有以下gnuplot数据文件
I have the following data file for gnuplot
1 0.5 0.9
2 -0.1 0.5
3 0.7 0.4
其中第一列是x轴,而2,3列是两个不同的图. x轴的坐标始终是自然数,它们代表单词在句子中的位置,第2列和第3列只是单词在句子中的作用结果.
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.
我想知道是否可以在x轴上用句子中的单词标记"1","2",....
I wonder if it's possible to label "1", "2" ,... on the x-axis with words from sentence.
如果我愿意
1 A 0.5 0.9
2 green -0.1 0.5
3 apple 0.7 0.4
然后代替1,2,3,我将拥有"A",绿色",苹果".
ans then in stead of 1,2,3 I would have "A" "green" "apple".
请让我知道是否可以使用gnuplot.
Please let me know if it's possible to do with gnuplot.
推荐答案
使用xticlabels
选择用于自定义标签的列:
Use xticlabels
to select a column for your custom labels:
plot 'file' using 1:3:xticlabels(2)
这篇关于gnuplot任意标记x-轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!