summaryrefslogtreecommitdiff
path: root/info/examples/PSTricks_7_de/14-05-8.ltx
blob: 124cce2591fc78c05e9ebb90c9e4a328c23dd7b0 (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
%% 
%%  Ein Beispiel der DANTE-Edition
%%  
%%  7. Auflage
%% 
%%  Beispiel 14-05-8 auf Seite 239.
%% 
%%  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{145.16928pt}
\setlength\parindent{0pt}
\usepackage{pst-plot}
\makeatletter
\pst@def{ScalePoints}<
  /y ED /x ED
  counttomark dup dup cvi eq not {exch pop} if
  /m exch def /n m 2 div cvi def
  n { y mul m 1 roll x mul m 1 roll
     /m m 2 sub def } repeat>
\makeatother

%StartShownPreambleCommands
\usepackage{pst-plot}
\psset{xunit=1cm,yunit=0.75cm}
\makeatletter
\def\plotValues#1{%
  \pscustom{\code{
    /xOffset 5 def   /yOffset -2 def
    /Times findfont 11 scalefont setfont
    /Feld [ #1 ] def /cnt 0 def
    Feld length 2 div cvi {
      /x Feld cnt get def /y Feld cnt 1 add get def
      x \pst@number\psxunit mul xOffset add
      y \pst@number\psyunit mul yOffset add
      moveto x 10 string cvs show
      /cnt cnt 2 add def
    } repeat }}}
\makeatother
\def\dataV{6.8 -1 5.9 -2 5.4 -3 5.7 -4 6.2 -5}
%StopShownPreambleCommands
\begin{document}
\begin{pspicture}(3.5,0.5)(8,-5.5)
  \psaxes[Ox=4]{->}(4,0)(8,-5)
  \listplot[plotstyle=curve,
    showpoints]{\dataV}
  \plotValues{\dataV}
\end{pspicture}
\end{document}