summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pstricks/voss/bsp05.tex
blob: 11b6fb30cb66f35befb3653d93fe37169e48f35e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% bsp05.tex ---
%% Autor           : Herbert Voss <voss@perce.de>
%% Datum           : 2004-04-25 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{dataError.dat}
-0.7 -0.4      0.1 0.5       -0.43 3        0   0.4
 1    4.6     -0.5 0.2        1.2  2.3     -0.2 0.2
 1.7  3.9     -0.1 1          2.7 -1.1     -0.2 0.3
 3.98 -0.7    -0.4 0          4.5  0.7539  -0.5 0.4
\end{filecontents}

\documentclass{article}
\usepackage{multido}
\usepackage{pstricks}
\usepackage{pst-plot}
\SpecialCoor

\makeatletter
\def\errorLine{\@ifnextchar[{\pst@errorLine}{\pst@errorLine[]}}
\def\pst@errorLine[#1](#2)#3#4{{%
  \ifx#1\empty\else\psset{#1}\fi
  \pst@getcoor{#2}\pst@tempa
  \def\@errorMin{#3}
  \def\@errorMax{#4}
  \psline{|-|}(!%
     /yDot \pst@tempa exch pop \pst@number\psyunit div def
     /xDot \pst@tempa pop \pst@number\psxunit div def
     xDot yDot \@errorMin\space add%
    )(!%
     /yDot \pst@tempa exch pop \pst@number\psyunit div def
     /xDot \pst@tempa pop \pst@number\psxunit div def
     xDot yDot \@errorMax\space add)
}}
%
\def\GetCoordinates#1{\expandafter\GetCoordinates@i#1}
\def\GetCoordinates@i #1{\GetCoordinates@ii#1}
\def\GetCoordinates@ii#1 #2 #3 #4 #5 #6 #7 #8 {%
  \DoCoordinate{#2}{#4}%
  \errorLine[linecolor=red, linewidth=2pt](#2,#4){#6}{#8}% <<<<<
  \@ifnextchar D{\GetCoordinates@ii}{}%
}
\makeatother

\parindent=0pt
\pagestyle{empty}
\begin{document}

\psset{dotscale=2,unit=1cm}%
  \readdata{\Data}{dataError.dat}
\begin{pspicture}(-1,-2)(5,5.5)
  \psaxes(0,0)(-1,-2)(5,5)
  \def\DoCoordinate#1#2{\psdot(#1,#2)}%
  \GetCoordinates{\Data}
\end{pspicture}

\show\Data% f|r das Logfile

\end{document}