summaryrefslogtreecommitdiff
path: root/info/examples/PSTricks_en/35-02-3.ltx
diff options
context:
space:
mode:
Diffstat (limited to 'info/examples/PSTricks_en/35-02-3.ltx')
-rw-r--r--info/examples/PSTricks_en/35-02-3.ltx112
1 files changed, 112 insertions, 0 deletions
diff --git a/info/examples/PSTricks_en/35-02-3.ltx b/info/examples/PSTricks_en/35-02-3.ltx
new file mode 100644
index 0000000000..cda03a5082
--- /dev/null
+++ b/info/examples/PSTricks_en/35-02-3.ltx
@@ -0,0 +1,112 @@
+%%
+%% A DANTE-Edition example
+%%
+%%
+%% Copyright (C) 2010 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[]{article}
+\pagestyle{empty}
+\setlength\textwidth{375.57637pt}
+\setlength\parindent{0pt}
+
+\usepackage{pstricks,pstricks-add}
+\newcommand{\up}[1]{\textsuperscript{#1}} % \up{2}1986 becomes >1986
+\makeatletter
+\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, #5, #6, #7){%
+%%%% the groups of lines
+% length abbreviations
+ \def\oZ{\the\pst@cntc\space .5 sub\space}% top
+ \def\mZ{\the\pst@cntc\space .2 sub\space}% centre
+ \def\uZ{\the\pst@cntc\space .1 add\space}% bottom
+ \def\enden{.12\space}%
+%% separator lines
+ \psline[linewidth=.2pt, dash = 4pt 1pt, linestyle = dashed]%
+ (!\Xmin\space \the\pst@cntc\space .3 add)%
+ (!\Xmax\space \the\pst@cntc\space .3 add)%
+% first effect
+ \psline[linewidth=1pt,linecolor=red](!#2 #3 sub \oZ \enden add) (!#2 #3 sub \oZ)(!#2 #3 add \oZ)
+ (!#2 #3 add \oZ \enden add) %
+ \psdot[dotangle = 180](!#2 \oZ)%
+ % third effect
+ \psline[linewidth=1pt,linecolor=green](!#6 #7 sub \uZ \enden sub) (!#6 #7 sub \uZ)(!#6 #7 add \uZ)
+ (!#6 #7 add \uZ \enden sub)%
+ \psdot(!#6 \uZ)%
+ % second effect (diamond over triangles)
+ \psline[linewidth=1pt,linecolor=blue](!#4 #5 sub \mZ) (!#4 #5 add \mZ)%
+ \psline[linewidth=1pt,linecolor=blue](!#4 #5 sub \mZ \enden sub)(!#4 #5 sub \mZ \enden add)%
+ \psline[linewidth=1pt,linecolor=blue](!#4 #5 add \mZ \enden sub)(!#4 #5 add \mZ \enden add)%
+ \psdot[dotstyle = Bdiamond](!#4 \mZ) %
+ \rput[rC]{0}(!\Xmin\space \the\pst@cntc\space .2 sub){\small\strut#1}%Y axis
+ \rput[rC]{0}(!\Xmin\space \the\pst@cntc\space .2 sub){\small\strut#1}%Y axis
+ \advance\pst@cntc by 1 % one unit to the right
+ \@ifnextchar({\psErrorPlot@iii}{\end@SpecialObj}% more data available?
+}
+\makeatother
+\def\data{
+% UV1 KI-UV1 UV2 KI-UV2 UV3 KI-UV3)
+ (UV1 , .01 , .06 , .01 , .06 , .01 , .04)
+ (UV2 , -.23 , .06 , .05 , .03 , .2 , .08)
+ (UV3 , -.12 , .08 , -.04 , .05 , -.09 , .06)
+ (UV4 , -.2 , .07 , -.1 , .06 , -.24 , .05)
+ (UV5 , -.24 , .04 , -.1 , .1 , .08 , .08)}
+
+
+\begin{document}
+\psset{dotstyle=Btriangle,linewidth= .6pt, tickstyle=top,dotsize = 6pt, framearc = .2,
+ yunit= -1,% negative, 1 effect on top
+ xunit = 15}%
+ % length abbreviations for the legend
+ \def\lines{5\space}%
+ \def\Xmin{-.32\space}\def\Xmax{.31\space}% effect range
+ \def\legx{.2\space} \def\legy{3.4\space}% position of legend
+ \def\uZ{\legy\space 1 add\space}%
+ \def\mZ{\legy\space .5 add\space}%
+ \def\enden{.12\space}%
+ \def\TrBoy{.3 add} \def\pshlabel#1{\footnotesize#1}
+ \begin{pspicture}(-.5,-1)(5,\lines)
+ % axis definition
+ \psaxes[showorigin=false,linewidth=.4pt,yAxis=false,Dx = .1](0,.1)(\Xmin, 0)(\Xmax,30)
+ % centre line
+ \psline[linewidth=.1pt, dash=4pt 1pt,linestyle = dashed](0,.4)(!0 \lines)
+%% separator boxes for different blocks of variables
+ \psset{linewidth = .3pt}%
+ \psframe(!-.39 .1) (!.33 3 \TrBoy)%
+ \psframe(!-.39 3 \TrBoy)(!.33 5 \TrBoy)
+ %% the diagram
+ \psErrorPlot{\data}
+ % legend at the beginning
+ \psframe[fillcolor=white,fillstyle=solid, framearc=.2]%
+ (!\legx .06 sub \uZ .3 add)(!\legx .09 add \legy .4 sub)
+ % labels in the legend
+ \rput[rC]{0}(!\legx \legy){\footnotesize AV1}
+ \rput[rC]{0}(!\legx \legy .5 add){\footnotesize AV2}
+ \rput[rC]{0}(!\legx \legy .95 add){\footnotesize AV3}
+ % first effect in the legend
+ \psset{linewidth = 1pt}%
+ \psline[linecolor=red](!\legx .01 add \legy \enden add)(!\legx .01 add \legy)
+ (!\legx .07 add \legy) (!\legx .07 add \legy \enden add)
+ \psdot[dotangle = 180](!\legx .04 add \legy)%
+ % third effect in the legend
+ \psline[linecolor=green](!\legx .01 add \uZ \enden sub) (!\legx .01 add \uZ)
+ (!\legx .07 add \uZ) (!\legx .07 add \uZ \enden sub)
+ \psdot(!\legx .04 add \uZ)%
+ % second effect in the legend
+ \psline[linecolor=blue](!\legx .01 add \mZ) (!\legx .07 add \mZ)
+ \qline(!\legx .01 add \mZ \enden sub)(!\legx .01 add \mZ \enden add)
+ \qline(!\legx .07 add \mZ \enden sub)(!\legx .07 add \mZ \enden add)
+ \psdot[dotstyle = Bdiamond](!\legx .04 add \mZ)
+ \end{pspicture}
+\end{document}