# [pstricks] How to draw error bars in a diagram

Martin Buchmann Martin_Buchmann at gmx.net
Mon Apr 28 16:24:59 CEST 2003

```Herbert,

Herbert Voss wrote:

> I do not know, if I understand well.

Well, first of all thanks for your example! It comes close to what i
want/need :-)

Let me try to explain it once more maybe i can make it clearer. I have
some measured values and these are not completly correct as always in
reality, e.g., i can measure a copper concetration of 1.68wt% at the
spot x of my sample but it's more likely that the concetration is 1.7wt%
+- 0.1wt% (at least :-) due to the used setup. Therefore i want to plot
the value of 1.7wt% as a dot and a line from 1.6wt% to 1.8wt%.

So basically i would need something like make pstricks read data in the form:

x y dy- dy+

and plot the dot at (x,y) and the line from (x,dy-) to (x,dy+). Maybe
dy- and dy+ are aquidistanced from y maybe not so it's nicer to have
them both explicit. One could even think about an error range for x so
that the input data would become:

x y dx- dx+ dy- dy+

I do not know if this is possible or only with a lot of effort. But it
would be a nice thing to have. A much easier way (as far as i can judge
this) would be what you did in your example. So estimate that with the
used method the error in the concetration value is about 5% of the
current value and even a fixed value, e.g., 0.1wt% and draw the line
like you did. I don't think anyone can tell the difference if he/she
just sees the diagram :-)

If there is no problem using your solution with fileplot and make the
linestyle |-| i'm quite happy with it! I will check how i come along
with it when i have a bit of time...

Thanks once more for your time and effort
Martin

--
What ever you want is going to cost a little more than it is worth.
-- The Second Law Of Thermodynamics
```