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?


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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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