Debian Codegraph @

texmf-dist/doc/generic/pgf/pgfmanual-en-dv-examples.tex

raw
1 % Copyright 2019 by Till Tantau
2 %
3 % This file may be distributed and/or modified
4 %
5 % 1. under the LaTeX Project Public License and/or
6 % 2. under the GNU Free Documentation License.
7 %
8 % See the file doc/generic/pgf/licenses/LICENSE for more details.
9
10
11 A first example:
12
13 \begin{codeexample}[preamble={\usetikzlibrary{datavisualization.formats.functions}}]
14 \begin{tikzpicture}[baseline]
15 \datavisualization [
16 school book axes,
17 visualize as smooth line,
18 clean ticks,
19 all axes={grid={step=1,minor steps between steps=1}},
20 x axis={
21 ticks={
22 major={
23 also at={(0.5*pi) as $\pi/2$},
24 also at={(pi) as $\pi$},
25 options at=3 as [no tick text]
26 }
27 },
28 label=$x$
29 },
30 y axis={
31 label=$y$,
32 }
33 ]
34 data [format=function] {
35 var x : interval [-0.5*pi:4] samples 50;
36 func y = sin(\value x r);
37 };
38 \end{tikzpicture}
39 \end{codeexample}
40 %
41 \begin{codeexample}[preamble={\usetikzlibrary{datavisualization.formats.functions}}]
42 \begin{tikzpicture}[baseline]
43 \datavisualization [
44 scientific axes=clean,
45 visualize as line,
46 all axes={padding=4pt},
47 x axis={logarithmic,
48 ticks={many, tick unit={ms},
49 node style={rotate=45,anchor=north east}},
50 label={time},
51 grid},
52 y axis={label={distance}},
53 ]
54 data {
55 x, y, z
56 0.001, 0, 0
57 2000, 2.23, 2
58 20670, 1, 3
59 501, -2, 0
60 };
61 \end{tikzpicture}
62 \end{codeexample}
63
64 \begin{codeexample}[preamble={\usetikzlibrary{datavisualization}}]
65 \begin{tikzpicture}[baseline,mark=*]
66 \datavisualization [
67 scientific axes=inner ticks,
68 all axes={padding=4pt},
69 euro about strategy,
70 visualize as scatter,
71 x axis={attribute=x2},
72 y axis={attribute=y2}
73 ]
74 data [separator=\space] {
75 x y x1 y1 x2 y2 x3 y3
76 10.0 8.04 10.0 9.14 10.0 7.46 8.0 6.58
77 8.0 6.95 8.0 8.14 8.0 6.77 8.0 5.76
78 13.0 7.58 13.0 8.74 13.0 12.74 8.0 7.71
79 9.0 8.81 9.0 8.77 9.0 7.11 8.0 8.84
80 11.0 8.33 11.0 9.26 11.0 7.81 8.0 8.47
81 14.0 9.96 14.0 8.10 14.0 8.84 8.0 7.04
82 6.0 7.24 6.0 6.13 6.0 6.08 8.0 5.25
83 4.0 4.26 4.0 3.10 4.0 5.39 19.0 12.50
84 12.0 10.84 12.0 9.13 12.0 8.15 8.0 5.56
85 7.0 4.82 7.0 7.26 7.0 6.42 8.0 7.91
86 5.0 5.68 5.0 4.74 5.0 5.73 8.0 6.89
87 };
88 \end{tikzpicture}
89 \end{codeexample}
90
91
92 %%% Local Variables:
93 %%% mode: latex
94 %%% TeX-master: "pgfmanual"
95 %%% End: