gnuplot arbitrary labeling x - axis

南楼画角 提交于 2019-12-23 12:30:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!