use text column from data file as points label in gnuplot

gnuplot, label

Solution

You can do something like

plot 'file' using 0:2 title 'title', \
     '' using 0:2:1 with labels offset 0,char 1

This will first plot the data normally, then plot with labels on top, offset up by one character. The `0` column is a dummy column which gives an index to the data--0 for the first data point, 1 for the second, etc.

Another alternative would be to plot using a histogram.

Problem

I have a data file consisting of 2 columns with a name and value in it. ``` foo 0.1 bar 0.2 fff 0.4 bbb 0.7 ``` I want to plot this and annotate the text entry next to the data point. I tried ``` plot 'file' using 1:2 with labels ``` but it didn't work. I guess the proble is that I have to rely on gnuplot using only the second column for y and equally spacing the x axis.

Original source

Related problems