Debian Codegraph @

texmf-dist/doc/latex/tkz-fct/TKZdoc-fct-symbol.tex

raw
1 \section{Symboles}
2 Certains ajoutent aux courbes des symboles afin de donner des indications supplémentaires au lecteur. Voici quelques exemples possibles~:
3
4 \begin{tikzpicture}
5 \draw[thick,(-)](0,0)--(2,2);
6 \draw[thick,o-o](2,0)--(4,2);
7 \draw[thick,)-(](4,0)--(6,2);
8 \draw[thick,*-*](6,0)--(8,2);
9 \end{tikzpicture}
10
11 \newcommand{\cred}[1]{{\color{red}#1}}
12 \newcommand{\cgreen}[1]{{\color{green!50!black}#1}}
13 \newcommand{\cblue}[1]{{\color{blue}#1}}
14
15 L'exemple suivant est de \tkzname{Simon Schläpfer}~:
16
17 On veut tracer
18 \[
19 y=\left\{\begin{array}{ll}
20 \cred{8-1.5x}&,\text{if }x<2\\
21 \cblue{4}&,\text{if }2 \leq x \leq 3\\
22 \cgreen{2x-4}&,\text{if } x>3
23 \end{array}
24 \right.
25 \]
26
27 \begin{center}
28 \begin{tkzexample}[vbox]
29 \begin{tikzpicture}
30 \tkzInit[xmin=-1,xmax=6,ymin=0,ymax=10,xstep=1,ystep=1]
31 \tkzGrid[color=gray]
32 \tkzAxeXY
33 \tkzFct[{-[},color=red,domain =-1:2,samples=2]{8-1.5*\x}
34 \tkzFct[{[-]},color=blue,domain =2:3,samples=2]{4}
35 \tkzFct[{]-},color=green!50!black,domain =3:6,samples=2]{2*\x-4}
36 \end{tikzpicture}
37 \end{tkzexample}
38
39 \end{center}
40
41
42 \endinput