TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. 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

In pgfplots, if you want error bars, you have to write error bars/.cd into each addplot that should have error bars. What does it mean and what does it do and why do I need it?

share|improve this question
up vote 4 down vote accepted

cd means change directory.

This command will prefix all successive keys by the key "error bars/" automatically

Edit: Why do you need it? I do not have the time to check the code, but I suppose that drawing an error bar needs to do something a little different than drawing a normal plot. So it probably needs to redefine some keys or functions.

For example:


will use the key mark (probably /pgfplots/mark)


\addplot[error bars/.cd,mark=o]

will use the key error bars/mark (probably /pgfplots/error bars/mark), that may have a totally different meaning, adapted to plot a graph with error bars...

share|improve this answer
Thanks, now it's clear to me. :) – Foo Bar Feb 12 '13 at 13:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.