Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't get gnuplot to make a plot with error bars when my x values are non-numeric.

For an example "data.dat":

day        col1  col2
MONDAY     12    4
TUESDAY    10    3
WEDNESDAY  9     2
THURSDAY   11    3
FRIDAY     9     2
SATURDAY   12    3
SUNDAY     8     2

I've tried variants of

plot "./data.dat" using 2:3:xtic(1) with yerrorlines
plot "./data.dat" using 2:3:xtic(1) with yerrorlines
plot "./data.dat" using 1:2:3 with yerrorlines

And get back either Not enough columns for this style or
warning: Skipping data file with no valid points x range is invalid

What would the plot command be to plot (day,col1,col2) => (x,y,y_err)?

share|improve this question
up vote 4 down vote accepted

xtic, or xticlabels, does not count as a data column. That is why yerrorlines is complaining about not enough columns. You can provide the implicit column 0 for an enumeration.

plot "./data.dat" using 0:2:3:xticlabels(1) with yerrorlines
share|improve this answer
And when not using with yerrorlines there is an implicit column 0 when plot doesn't have enough columns? Odd... – Andrew Wood Apr 19 '11 at 12:53

You must log in to answer this question.

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