Debian Codegraph @

texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex

raw
1 % Copyright 2018 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 Public License.
7 %
8 % See the file doc/generic/pgf/licenses/LICENSE for more details.
9
10 \ProvidesFileRCS{pgflibraryplotmarks.code.tex}
11
12
13 % A stroked circle mark
14
15 \pgfdeclareplotmark{o}
16 {%
17 \pgfpathellipse{\pgfpointorigin}{\pgfqpoint{\pgfplotmarksize}{0sp}}{\pgfqpoint{0sp}{\pgfplotmarksize}}%
18 \pgfusepathqstroke
19 }%
20
21
22 % A Mercedes-line star
23
24 \pgfdeclareplotmark{Mercedes star}
25 {%
26 \pgfpathmoveto{\pgfqpointpolar{90}{\pgfplotmarksize}}%
27 \pgfpathlineto{\pgfpointorigin}%
28 \pgfpathmoveto{\pgfqpointpolar{-30}{\pgfplotmarksize}}%
29 \pgfpathlineto{\pgfpointorigin}%
30 \pgfpathmoveto{\pgfqpointpolar{-150}{\pgfplotmarksize}}%
31 \pgfpathlineto{\pgfpointorigin}%
32 \pgfusepathqstroke
33 }%
34
35 \pgfdeclareplotmark{Mercedes star flipped}
36 {%
37 \pgfpathmoveto{\pgfqpointpolar{-90}{\pgfplotmarksize}}%
38 \pgfpathlineto{\pgfpointorigin}%
39 \pgfpathmoveto{\pgfqpointpolar{30}{\pgfplotmarksize}}%
40 \pgfpathlineto{\pgfpointorigin}%
41 \pgfpathmoveto{\pgfqpointpolar{150}{\pgfplotmarksize}}%
42 \pgfpathlineto{\pgfpointorigin}%
43 \pgfusepathqstroke
44 }%
45
46
47
48
49 % A six-pointed star mark
50
51 \pgfdeclareplotmark{asterisk}
52 {%
53 \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
54 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
55 \pgfpathmoveto{\pgfqpointpolar{30}{\pgfplotmarksize}}%
56 \pgfpathlineto{\pgfqpointpolar{210}{\pgfplotmarksize}}%
57 \pgfpathmoveto{\pgfqpointpolar{-30}{\pgfplotmarksize}}%
58 \pgfpathlineto{\pgfqpointpolar{-210}{\pgfplotmarksize}}%
59 \pgfusepathqstroke
60 }%
61
62
63 % A five-pointed star mark
64
65 \pgfdeclareplotmark{star}
66 {%
67 \pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
68 \pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfqpointpolar{18}{\pgfplotmarksize}}%
69 \pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfqpointpolar{-54}{\pgfplotmarksize}}%
70 \pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfqpointpolar{234}{\pgfplotmarksize}}%
71 \pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}%
72 \pgfusepathqstroke
73 }%
74
75
76 % An 10-pointed star mark
77
78 \pgfdeclareplotmark{10-pointed star}
79 {%
80 \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
81 \pgfpathmoveto{\pgfqpointpolar{18}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{18}{\pgfplotmarksize}}%
82 \pgfpathmoveto{\pgfqpointpolar{-54}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{-54}{\pgfplotmarksize}}%
83 \pgfpathmoveto{\pgfqpointpolar{234}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{234}{\pgfplotmarksize}}%
84 \pgfpathmoveto{\pgfqpointpolar{162}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}%
85 \pgfusepathqstroke
86 }%
87
88
89 % An \oplus mark
90
91 \pgfdeclareplotmark{oplus}
92 {%
93 \pgfpathcircle{\pgfpointorigin}{\pgfplotmarksize}%
94 \pgfpathmoveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
95 \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
96 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
97 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
98 \pgfusepathqstroke
99 }%
100
101 \pgfdeclareplotmark{oplus*}
102 {%
103 \pgfpathcircle{\pgfpointorigin}{\pgfplotmarksize}%
104 \pgfpathmoveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
105 \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
106 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
107 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
108 \pgfusepathqfillstroke
109 }%
110
111
112 % An \otimes mark
113
114 \pgfdeclareplotmark{otimes}
115 {%
116 \pgfpathcircle{\pgfpointorigin}{\pgfplotmarksize}%
117 \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}%
118 \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}%
119 \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}%
120 \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}%
121 \pgfusepathqstroke
122 }%
123
124 \pgfdeclareplotmark{otimes*}
125 {%
126 \pgfpathcircle{\pgfpointorigin}{\pgfplotmarksize}%
127 \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}%
128 \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}%
129 \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}%
130 \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}%
131 \pgfusepathqfillstroke
132 }%
133
134
135 % A vertical bar mark
136
137 \pgfdeclareplotmark{|}
138 {%
139 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
140 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
141 \pgfusepathqstroke
142 }%
143
144
145
146 % A horizontal bar mark
147
148 \pgfdeclareplotmark{-}
149 {%
150 \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
151 \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
152 \pgfusepathqstroke
153 }%
154
155
156 % A square stroked mark
157
158 \pgfdeclareplotmark{square}
159 {%
160 \pgfpathrectangle{\pgfqpoint{-\pgfplotmarksize}{-\pgfplotmarksize}}{\pgfqpoint{2\pgfplotmarksize}{2\pgfplotmarksize}}%
161 \pgfusepathqstroke
162 }%
163
164 % A square stroked-filled mark
165
166 \pgfdeclareplotmark{square*}
167 {%
168 \pgfpathrectangle{\pgfqpoint{-\pgfplotmarksize}{-\pgfplotmarksize}}{\pgfqpoint{2\pgfplotmarksize}{2\pgfplotmarksize}}%
169 \pgfusepathqfillstroke
170 }%
171
172
173 % A triangle mark
174
175 \pgfdeclareplotmark{triangle}
176 {%
177 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
178 \pgfpathlineto{\pgfqpointpolar{-30}{\pgfplotmarksize}}%
179 \pgfpathlineto{\pgfqpointpolar{-150}{\pgfplotmarksize}}%
180 \pgfpathclose
181 \pgfusepathqstroke
182 }%
183
184
185 % A stroke-filled triangle mark
186
187 \pgfdeclareplotmark{triangle*}
188 {%
189 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
190 \pgfpathlineto{\pgfqpointpolar{-30}{\pgfplotmarksize}}%
191 \pgfpathlineto{\pgfqpointpolar{-150}{\pgfplotmarksize}}%
192 \pgfpathclose
193 \pgfusepathqfillstroke
194 }%
195
196
197
198 % A diamond-shaped mark
199
200 \pgfdeclareplotmark{diamond}
201 {%
202 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
203 \pgfpathlineto{\pgfqpoint{.75\pgfplotmarksize}{0pt}}%
204 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
205 \pgfpathlineto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
206 \pgfpathclose
207 \pgfusepathqstroke
208 }%
209
210
211 % A stroke-filled diamond-shaped mark
212
213 \pgfdeclareplotmark{diamond*}
214 {%
215 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
216 \pgfpathlineto{\pgfqpoint{.75\pgfplotmarksize}{0pt}}%
217 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
218 \pgfpathlineto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
219 \pgfpathclose
220 \pgfusepathqfillstroke
221 }%
222
223
224
225 % A pentagon-shaped mark
226
227 \pgfdeclareplotmark{pentagon}
228 {%
229 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
230 \pgfpathlineto{\pgfqpointpolar{18}{\pgfplotmarksize}}%
231 \pgfpathlineto{\pgfqpointpolar{-54}{\pgfplotmarksize}}%
232 \pgfpathlineto{\pgfqpointpolar{234}{\pgfplotmarksize}}%
233 \pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}%
234 \pgfpathclose
235 \pgfusepathqstroke
236 }%
237
238 % A stroke-filled pentagon-shaped mark
239
240 \pgfdeclareplotmark{pentagon*}
241 {%
242 \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
243 \pgfpathlineto{\pgfqpointpolar{18}{\pgfplotmarksize}}%
244 \pgfpathlineto{\pgfqpointpolar{-54}{\pgfplotmarksize}}%
245 \pgfpathlineto{\pgfqpointpolar{234}{\pgfplotmarksize}}%
246 \pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}%
247 \pgfpathclose
248 \pgfusepathqfillstroke
249 }%
250
251 \newif\ifpgfmarktext@usetikznode
252 \pgfkeys{
253 /pgf/text mark/.initial=p,
254 /pgf/text mark style/.initial=,
255 /pgf/text mark as node/.is if=pgfmarktext@usetikznode,
256 /pgf/text mark as node/.default=true,
257 %
258 % backw. compat: the extra search path confuses the '.unknown'
259 % handlers, so this here is deprecated:
260 /pgf/text mark/style/.style={/pgf/text mark style={#1}},%
261 /pgf/text mark/as node/.style={/pgf/text mark as node={#1}},%
262 }%
263
264 \pgfdeclareplotmark{text}
265 {
266 \pgfkeysgetvalue{/pgf/text mark style}\pgfmarktext@style
267 \pgfkeysgetvalue{/pgf/text mark}\pgfmarktext@
268 \ifpgfmarktext@usetikznode
269 \expandafter\node\expandafter[\pgfmarktext@style]{\pgfmarktext@};
270 \else
271 \expandafter\pgftext\expandafter[\pgfmarktext@style]{\pgfmarktext@}%
272 \fi
273 }%
274
275 \pgfkeysdef{/pgf/mark color}{\def\pgf@mark@color{#1}}%
276 \let\pgf@mark@color\pgfutil@empty
277
278 \def\pgf@set@mark@color{%
279 \ifx\pgf@mark@color\pgfutil@empty
280 \pgfsys@color@rgb@fill{1}{1}{1}%
281 \else
282 \pgfsetfillcolor{\pgf@mark@color}%
283 \fi
284 }%
285 \def\pgf@mark@color@none{none}%
286
287 % A half-down-filled and half-up-filled-white diamond-shaped mark
288 % (the shape can be rotated by "mark options = {rotate = 90}")
289 % created by Tomek
290
291 \pgfdeclareplotmark{halfcircle}{%
292 \ifx\pgf@mark@color@none\pgf@mark@color
293 \else
294 \pgfscope
295 \pgf@set@mark@color
296 \pgfpathmoveto
297 {\pgfqpoint{-\pgfplotmarksize}{0pt}}%
298 \pgfpatharc{180}{360}{\pgfplotmarksize}%
299 \pgfusepathqfill
300 \endpgfscope%
301 \fi
302 \pgfpathmoveto
303 {\pgfqpoint{-\pgfplotmarksize}{0pt}}%
304 \pgfpathlineto
305 {\pgfqpoint{\pgfplotmarksize}{0pt}}%
306 \pgfpathcircle{\pgfpointorigin}%
307 {\pgfplotmarksize}%
308 \pgfusepathqstroke
309 }%
310 \pgfdeclareplotmark{halfcircle*}{%
311 \pgfpathmoveto
312 {\pgfqpoint{\pgfplotmarksize}{0pt}}%
313 \pgfpatharc{0}{180}{\pgfplotmarksize}%
314 \pgfpathclose
315 \pgfusepathqfill
316 \ifx\pgf@mark@color@none\pgf@mark@color
317 \else
318 \pgfscope
319 \pgf@set@mark@color
320 \pgfpathmoveto
321 {\pgfqpoint{-\pgfplotmarksize}{0pt}}%
322 \pgfpatharc{180}{360}{\pgfplotmarksize}%
323 \pgfusepathqfill
324 \endpgfscope%
325 \fi
326 \pgfpathcircle{\pgfpointorigin}%
327 {\pgfplotmarksize}%
328 \pgfusepathqstroke
329 }%
330
331 % A half-down-filled and half-up-filled-white diamond-shaped mark
332 % created by Magnus Tewes
333
334 \pgfdeclareplotmark{halfdiamond*}{%
335 \pgfpathmoveto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
336 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
337 \pgfpathlineto{\pgfqpoint{.75\pgfplotmarksize}{0pt}}%
338 \pgfusepathqfill
339 \ifx\pgf@mark@color@none\pgf@mark@color
340 \else
341 \pgfscope
342 \pgf@set@mark@color
343 \pgfpathmoveto{\pgfqpoint{.75\pgfplotmarksize}{0pt}}%
344 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
345 \pgfpathlineto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
346 \pgfusepathqfill
347 \endpgfscope
348 \fi
349 \pgfpathmoveto{\pgfqpoint{.75\pgfplotmarksize}{0pt}}%
350 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
351 \pgfpathlineto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
352 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
353 \pgfpathclose
354 \pgfusepathqstroke
355 }%
356
357 % A half-down-filled and half-up-filled-white tilted-squared-shaped mark
358 % created by Magnus Tewes
359
360 \pgfdeclareplotmark{halfsquare*}{%
361 \pgfpathmoveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
362 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
363 \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
364 \pgfusepathqfill
365 \ifx\pgf@mark@color@none\pgf@mark@color
366 \else
367 \pgfscope
368 \pgf@set@mark@color
369 \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
370 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
371 \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
372 \pgfusepathqfill
373 \endpgfscope
374 \fi
375 \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
376 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
377 \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
378 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
379 \pgfpathclose
380 \pgfusepathqstroke
381 }%
382
383 % A half-right-filled and half-up-filled-white tilted-squared-shaped mark
384 % created by Magnus Tewes
385
386 \pgfdeclareplotmark{halfsquare right*}{%
387 \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
388 \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
389 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
390 \pgfusepathqfill
391 \ifx\pgf@mark@color@none\pgf@mark@color
392 \else
393 \pgfscope
394 \pgf@set@mark@color
395 \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
396 \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
397 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
398 \pgfusepathqfill
399 \endpgfscope
400 \fi
401 \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
402 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
403 \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
404 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
405 \pgfpathclose
406 \pgfusepathqstroke
407 }%
408
409 % A half-left-filled and half-up-filled-white tilted-squared-shaped mark
410 % created by Magnus Tewes
411
412 \pgfdeclareplotmark{halfsquare left*}{%
413 \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
414 \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
415 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
416 \pgfusepathqfill
417 \ifx\pgf@mark@color@none\pgf@mark@color
418 \else
419 \pgfscope
420 \pgf@set@mark@color
421 \pgfpathmoveto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
422 \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
423 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
424 \pgfusepathqfill
425 \endpgfscope
426 \fi
427 \pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
428 \pgfpathlineto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
429 \pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
430 \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
431 \pgfpathclose
432 \pgfusepathqstroke
433 }%
434
435
436 % A stroke-filled heart-shaped mark
437 % created by Magnus Tewes
438 \pgfdeclareplotmark{heart}{%
439 \pgfpathmoveto{\pgfqpoint{0pt}{-1.75\pgfplotmarksize}}%
440 \pgfpathcurveto{\pgfqpoint{0pt}{-1.75\pgfplotmarksize}}{\pgfqpoint{0pt}{-1.66\pgfplotmarksize}}{\pgfqpoint{-.5\pgfplotmarksize}{-1.165\pgfplotmarksize}}%
441 \pgfpathcurveto{\pgfqpoint{-.5\pgfplotmarksize}{-1.165\pgfplotmarksize}}{\pgfqpoint{-\pgfplotmarksize}{-.75\pgfplotmarksize}}{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
442 \pgfpathcurveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}{\pgfqpoint{-\pgfplotmarksize}{.5825\pgfplotmarksize}}{\pgfqpoint{-.5825\pgfplotmarksize}{.5825\pgfplotmarksize}}%
443 \pgfpathcurveto{\pgfqpoint{-.5825\pgfplotmarksize}{.5825\pgfplotmarksize}}{\pgfqpoint{0pt}{.5825\pgfplotmarksize}}{\pgfqpoint{0pt}{0pt}}%
444 \pgfpathcurveto{\pgfqpoint{0pt}{0pt}}{\pgfqpoint{0pt}{.5825\pgfplotmarksize}}{\pgfqpoint{.5825\pgfplotmarksize}{.5825\pgfplotmarksize}}%
445 \pgfpathcurveto{\pgfqpoint{.5825\pgfplotmarksize}{.5825\pgfplotmarksize}}{\pgfqpoint{\pgfplotmarksize}{.5825\pgfplotmarksize}}{\pgfqpoint{\pgfplotmarksize}{0pt}}%
446 \pgfpathcurveto{\pgfqpoint{\pgfplotmarksize}{0pt}}{\pgfqpoint{\pgfplotmarksize}{-.75\pgfplotmarksize}}{\pgfqpoint{.5\pgfplotmarksize}{-1.165\pgfplotmarksize}}%
447 \pgfpathcurveto{\pgfqpoint{.5\pgfplotmarksize}{-1.165\pgfplotmarksize}}{\pgfqpoint{0pt}{-1.66\pgfplotmarksize}}{\pgfqpoint{0pt}{-1.75\pgfplotmarksize}}%
448 \pgfpathclose
449 \pgfusepathqfillstroke
450 }%
451
452
453 \endinput