Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
add comment

1 Answer 1

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:

\addplot[mark=o]

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

But

\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
add comment

Your Answer

 
discard

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.