blob: 67bdbcb02fed9d9ad9df610635a451a0f085977e (
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
|
%%
%% The LaTeX Graphics Companion, 2ed (first printing May 2007)
%%
%% Example 6-1-35 on page 327.
%%
%% 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{135.83385pt}
\StartShownPreambleCommands
\usepackage{pstricks,pst-plot}
\makeatletter
\newcommand\plotValues[1]{\pscustom{\code{%
/xOffset 5 def /yOffset -2 def
/Helvetica findfont 10 scalefont setfont
/Varray [ #1 ] def /cnt 0 def
Varray length 2 div cvi {
/x Varray cnt get def /y Varray 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
\StopShownPreambleCommands
\begin{document}
\begin{pspicture}(3.5,0.5)(8,-5)
\psaxes[Ox=4]{->}(4,0)(8,-5)
\newcommand*\dataV{ 6.8 -1 5.9 -2 5.4 -3 5.7 -4 6.2 -5 }
\listplot[plotstyle=curve,showpoints=true,
linecolor=blue]{\dataV}
\plotValues{\dataV}
\end{pspicture}
\end{document}
|