summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-base/latex/TKZdoc-base-marks.tex
blob: 97f9fabb12bc58fa182d68c4a925aa3ce58f2816 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
\section{Marks, marques ou symboles}

J'ai distingué  les points utilisés en géométrie euclidienne et les « marks » ou symboles que l'on peut rencontrés en statistiques.

Pour positionner le symbole, on utilise la macro \tkzcname{tkzDefPoint} pour définir correctement un point, puis   la macro \tkzcname{tkzDrawMark} pour tracer le symbole.

Il est fréquent d'avoir à tracer un nuage de points, j'ai donc créé une macro qui permet de définir plusieurs points rapidement.

Un symbole "mark" peut être mise à l'échelle , ce qui est parfois utile, mais en revanche si on  modifie différemment  les abscisses et les ordonnées alors les "marks" sont déformées.

Rappel: il était déjà possible de créer un nuage de points avec la macro \tkzcname{tkzDefPoints}, mais cela impose de donner une référence (un nom) à chaque point, ce qui est parfois fastidieux. La macro \tkzcname{tkzSetOfPoints}   permet de définir des points \tkzname{tkzPt1}, \tkzname{tkzPt2},etc.
La macro \tkzcname{tkzDefSetOfPoints} a été défini 

 
C'est ce qu'on appelle fréquemment « nuage de points». La différence par rapport à la macro  \tkzcname{tkzDefPoints}, c'est que la référence aux points est donnée par un préfixe (par défaut tkzPt) et le numéro du point. 
Les points ne sont pas tracés. Voir 
\hyperlink{label_tkzDefSetOfPoints}{tkzDefSetOfPoints}

\subsection{\tkzcname{tkzDrawSetOfPoints}} 

\begin{NewMacroBox}{tkzDrawSetOfPoints}{\oarg{local options}}
Permet de placer des symboles sur  les points définis par \tkzcname{tkzDefSetOfPoints}.

\medskip
\begin{tabular}{lll}
options             & défaut & définition   \\ 
\midrule
\TOline{prefix} {tkzPt} {préfixe des noms des points}
\end{tabular}
\end{NewMacroBox}

 \subsubsection{Tracé d'un nuage avec \tkzcname{tkzDrawSetOfPoints}} 
\begin{tkzexample}[latex=6cm,small] 
\begin{tikzpicture}[scale=0.75]
\tkzInit[xmax=6,ymin=1000,ymax=5000,ystep=1000]
\tkzDrawX[label=$m$,below=10pt]
\tkzDrawY[label=$R(m)$,above=10pt] 
\tkzLabelX[font=\scriptsize]
\tkzLabelY[font=\scriptsize]
\tkzDefSetOfPoints[show]{1/2000,2/3000,4/2500,5/4200}
\tkzDrawSetOfPoints[mark=ball,mark size=3pt]  
\end{tikzpicture}
\end{tkzexample}

\newpage   
\subsection{\tkzcname{tkzJoinSetOfPoints}} 

\begin{NewMacroBox}{tkzJoinSetOfPoints}{\oarg{local options}}
Permet de joindre les  symboles par des segments de droite. Il est possible d'utiliser bien sûr toutes les options de \TIKZ.

\medskip
\begin{tabular}{lll}
options             & défaut & définition   \\ 
\midrule
\TOline{prefix} {tkzPt} {préfixe des noms des points}
\end{tabular}
\end{NewMacroBox} 

\subsubsection{Lier les points d'un nuage avec \tkzcname{tkzJoinSetOfPoints}} 
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=1]
\tkzInit[xmax=5,
         ymin=1000,ymax=6000,ystep=1000]
\tkzDrawX[label=$m$,below=13pt]
\tkzDrawY[label=$R(m)$] 
\tkzLabelX[font=\scriptsize]
\tkzLabelY[font=\scriptsize]
\tkzDefSetOfPoints{%
   1/2000,2/3000,4/2500,5/4200}
\tkzJoinSetOfPoints[%
      thick,
      color=brown]
\tkzDrawSetOfPoints[%
      mark=ball
	,mark size=3pt]  
\end{tikzpicture} 
\end{tkzexample}

\subsubsection{Utilisation des points d'un nuage}
   
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=.5]
\tkzInit[xmax=5,ymin=1000,
         ymax=6000,ystep=1000]
\tkzGrid[color=orange!30]
\tkzDrawX[label=$m$,below=13pt]
\tkzDrawY[label=$R(m)$] 
\tkzLabelX[font=\scriptsize]
\tkzLabelY[font=\scriptsize] 
\tkzDefSetOfPoints[prefix=P]{%
   1/2000,2/3000,3/2000,4/2500,5/4200} 
\tkzDrawPolySeg[%
     color=brown!50,
     line width=2pt](P1,P2,P3,P4,P5) 
\end{tikzpicture} 
\end{tkzexample}
 
% \subsection{Mark option \tkzname{mark} et \tkzname{size}}   
\subsection{\tkzcname{tkzSetUpMark}}

\begin{NewMacroBox}{tkzSetUpMark}{\oarg{local options}}
\begin{tabular}{lll}
options &  défaut  & définition                 \\ 
\midrule
\TOline{liste}{no default}{exemple \tkzcname{tkzSetUpMark[mark=heart]}}
\end{tabular}

\end{NewMacroBox} 

\subsubsection{Deux nuages} 
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}
\tkzInit[xmax=5.5,ymin=1000,%
         ymax=6000,ystep=2000]
\tkzGrid[color=orange!30]
\tkzDrawX[label=$m$,below=13pt]
\tkzDrawY[above left,label=$R(m)$] 
\tkzLabelX[below right,font=\scriptsize]
\tkzLabelY[font=\scriptsize]
\tkzDefSetOfPoints{1/2000,2/3000,3/2000,
    4/2500,5/4200} 
\tkzDefSetOfPoints[prefix=P]{1/3200,2/4100,
    3/3300,4/3300,5/5000}  
\tkzSetUpMark[mark=heart,color=black,
   fill=red!30,size=4pt]
\tkzJoinSetOfPoints[thick,color=blue,double]
\tkzDrawSetOfPoints
\tkzJoinSetOfPoints[prefix=P,thick,color=orange]
\tkzDrawSetOfPoints[prefix=P,mark=square*,
     mark size=4pt,
     mark options={color=blue,fill=blue!40}]  
\tkzText[draw,color = red,
        fill  = orange!20](3,5800)%
        {Recette en fonction du mois}
  \end{tikzpicture}  
\end{tkzexample}

\subsection{\tkzcname{tkzDrawMark}} 

\begin{NewMacroBox}{tkzDrawMark}{\oarg{local options}\parg(point)}
Place un symbole. Plus efficace que la suivante pour placer un seul symbole.

\medskip
\begin{tabular}{lll}
options             & défaut & définition   \\ 
\midrule
\TOline{prefix} {tkzPt} {préfixe des noms des points}
\end{tabular}
\end{NewMacroBox} 
 

\begin{tkzexample}[latex=7cm,small]
  \begin{tikzpicture}
  \tkzInit[xmax=3,ymax=1]
  \tkzAxeXY 
  \tkzDrawMark[mark=ball](1,.5)
  \end{tikzpicture}
\end{tkzexample}


\subsection{\tkzcname{tkzDrawMarks}} 

\begin{NewMacroBox}{tkzDrawMarks}{\oarg{local options}\parg(list of points)}
Permet de placer une série de marques.

\medskip
\begin{tabular}{lll}
options             & défaut & définition   \\ 
\midrule
\TOline{prefix} {tkzPt} {préfixe des noms des points}
\end{tabular}
\end{NewMacroBox}   

\subsubsection{Mark et nuage; utilisation de \tkzcname{tkzDrawMarks}}
\begin{tkzexample}[latex=7cm,small]
  \begin{tikzpicture}
  \tkzInit[xmax=6,ymin=1000,
          ymax=5000,ystep=1000]
  \tkzAxeXY 
  \tkzDefSetOfPoints[prefix=P]{%
        1/2000, 
        2/3000,
        4/2500, 
        5/4200} 
  \tkzDrawSegments[color=brown!50]%
(P1,P2 P2,P3 P3,P4)  
  \tkzDrawMarks[mark=ball](P1,P2,P3,P4)
  \end{tikzpicture}
\end{tkzexample}
 
 
\endinput