summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/6-1-36.ltx
blob: db77ddad9dd2b7a37d24b43d220a0990aa62f9e3 (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
%% 
%%  The LaTeX Graphics Companion, 2ed (first printing May 2007)
%% 
%%  Example 6-1-36 on page 329.
%% 
%%  Copyright (C) 2007 Michel Goossens, Frank Mittelbach, Denis Roegel, Sebastian Rahtz, Herbert Vo\ss 
%% 
%%  It may be distributed and/or modified under the conditions
%%  of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%% 
%%  See http://www.latex-project.org/lppl.txt for details.
%% 

\documentclass{ttctexa}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{159.83385pt}

\makeatletter
\def\pserrorLine{\pst@object{pserrorLine}}
\def\pserrorLine@i(#1)#2#3{\begingroup
  \use@par \pst@getcoor{#1}\pst@tempA
  \def\ps@errorMin{#2}\def\ps@errorMax{#3}%
  \psline{|-|}(! /yDot \pst@tempA exch pop \pst@number\psyunit div def
                 /xDot \pst@tempA pop \pst@number\psxunit div def
                 xDot yDot \ps@errorMin\space add )
              (! /yDot \pst@tempA exch pop \pst@number\psyunit div def
                 /xDot \pst@tempA pop \pst@number\psxunit div def
                 xDot yDot \ps@errorMax\space add)
  \endgroup}
\def\GetCoordinates#1{\expandafter\GetCoordinates@i#1}
\def\GetCoordinates@i#1{\GetCoordinates@ii#1}
\def\GetCoordinates@ii D #1 D #2 D #3 D #4 {%
  \DoCoordinate{#1}{#2}%
  \pserrorLine[linecolor=blue, linewidth=1.5pt](#1,#2){#3}{#4}%
  \@ifnextchar D{\GetCoordinates@ii}{}}
\makeatother
\StartShownPreambleCommands
\usepackage{pstricks,pst-plot} \SpecialCoor
% \GetCoordinates definition as above
\newcommand*\DoCoordinate[2]{\psdot(#1,#2)}
\StopShownPreambleCommands
\begin{document}
\readdata{\Data}{pstricks/dataError.dat}
\psset{dotscale=2,unit=0.75}
\begin{pspicture}(-1,-2)(5,5.5)
  \psaxes(0,0)(-1,-2)(5,5)
  \GetCoordinates{\Data}
\end{pspicture}
\end{document}