summaryrefslogtreecommitdiff
path: root/info/examples/PSTricks_7_de/35-00-55.ltx
blob: f57e4a3f77212e5108df24f8b22c7e2d5f3a637e (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
61
62
63
%% 
%%  Ein Beispiel der DANTE-Edition
%%  
%%  7. Auflage
%% 
%%  Beispiel 35-00-55 auf Seite 841.
%% 
%%  Copyright (C) 2016 Herbert Voss
%% 
%%  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.
%% 
%% 
%% ==== 
% Show page(s) 1
%% 
%% 
\documentclass[]{exaarticle}
\pagestyle{empty}
\setlength\textwidth{352.81416pt}
\setlength\parindent{0pt}
%StartShownPreambleCommands
\usepackage{pstricks-add}
%StopShownPreambleCommands
\begin{document}
\def\data{
(A, 10, 5.2, a)
(Amerika, 10, 5.2, b)
(B, 12, 3.8, c)
(C, 32.21, .54, d)
(De, 12.32, 74.3, nnn)
(E, 12.2, 12, NN)
(F, 123, 1.2, 34)
}
\makeatletter
\def\pshlabel#1{}
\def\psErrorPlot{\pst@object{psErrorPlot}}
\def\psErrorPlot@i#1{\begin@SpecialObj\expandafter\psErrorPlot@ii#1}
\def\psErrorPlot@ii #1{\pst@cntc=1\psErrorPlot@iii#1}
\def\psErrorPlot@iii(#1,#2,#3,#4){%  die fünf Werte pro Satz
  \psline[style=barstyle](\the\pst@cntc,0)(\the\pst@cntc,#2)%
  \psline[style=errorstyle](\the\pst@cntc,#2)(!\the\pst@cntc\space #2 #3 add)
  \uput[-90](\the\pst@cntc,0){\strut#1}% #1 Beschriftung
  \uput[90](!\the\pst@cntc\space #2 #3 add){\small #4}% #5 Beschriftung
  \advance\pst@cntc by 1 % Eine EInheit weiter nach rechts
  \@ifnextchar({\psErrorPlot@iii}{\end@SpecialObj}% noch Daten da?
}
\makeatother
\newpsstyle{errorstyle}{arrows=-|,arrowscale=2,
  linewidth=1pt,linecolor=red}% Stil für den Fehlerbalken
\newpsstyle{barstyle}{linecolor=blue!50,linewidth=5mm}% Stil für den Balken

\psset{yunit=0.08}
%\psframebox{%
\begin{pspicture}(-4\pslabelsep,-3\pslabelsep)(10,130)
  \psaxes[Dy=20,dy=20\psyunit](0,0)(10,120)
  \psErrorPlot{\data}
\end{pspicture}
%}
\end{document}