[Tex/LaTex] pgfplots with symbolic x coords and error bars


I am trying to plot explicit error bars like this:

\begin{axis} [symbolic x coords={Lighting,Computers,Total}]
\addplot+[only marks] plot[error bars/.cd, y dir=both, y explicit]
    (Lighting,0.12) +- (0.31,0.03)
    (Computers,0.06) +- (0.12,0.01) 
    (Total,0.07) +- (0.14,0.02)

Except this produces a constant error instead of the explicit values I have provided. For example, for Lighting, it produces 0.12 +-0.03 (see below). Did I misread the manual?! There is also some weirdness with the labels on the x-axis and I'd rather not have the y-axis use exponential notation for y<0.1. (I tried posting the output, but apparently I need more cred!)

Best Answer

Starting from PGFPlots version 1.9, asymmetric error bars are directly supported:


x         y    y-max  y-min
Lighting  0.12 0.31   0.03
Computers 0.06 0.12   0.01 
Total     0.07 0.14   0.02

\begin{axis} [
    symbolic x coords={Lighting,Computers,Total},
\addplot [only marks] 
  plot [error bars/.cd, y dir=both, y explicit]
  table [y error plus=y-max, y error minus=y-min] {\mytable};


Related Question