I have a file, file.dat, that contains string and numeric xticlabels

STD 0.34 0.04
0.1 0.4  0.03
0.2 0.3  0.04
0.3 0.31 0.045

Column No.1 is for xticlabels, Column 2 is for value to plot against xlabels and Column 3 if for yerror bars.

I want to plot this file with yerrorbars, labels and separate title and colour for each row, but problem is that with yerrorbars, xtics are problematic and without yerrorbars, xtics are displayed correctly.

I tried without yerrorbars and it gave correct result

plot "file.dat" u 2:xticlabels(1)

correct plot without yerrorbars

However, when i tried to plot yerrorbars also it gave incorrect xlabels. I have used this command

plot "file.dat" u 2:xticlabels(1):3 w yerrorbars

Now I get this result with incorrect x labels and column 3 values are shown in xticlabels

wrong xlabels

Can anyone tell me how can I get it correct with yerrorbars with separate title and color for each row?

1 Answer 1


Please use this, instead of your plot command.

set xrange [-1:4]
plot "file.dat" using 0:2:3:xticlabels(1) with yerrorbars

The special column number 0 in using spec means the sequential order of each point within a data set which start from 0. For detail, see help pseudocolumns. By using this, you have explicitly given an integer value for x that is incremented by one.

And, note that xticslabels is appended to the end of the using spec.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .