| 1 |
|
| 2 |
\def\eps{\textsc{eps}} |
| 3 |
|
| 4 |
\input pgfmanual-en-macros.tex |
| 5 |
|
| 6 |
\def\pgfmanualbar{\char`\|} |
| 7 |
\makeatletter |
| 8 |
\newenvironment{addplotoperation}[3][]{ |
| 9 |
\begin{pgfmanualentry} |
| 10 |
{% |
| 11 |
\let\ltxdoc@marg=\marg |
| 12 |
\let\ltxdoc@oarg=\oarg |
| 13 |
\let\ltxdoc@parg=\parg |
| 14 |
\let\ltxdoc@meta=\meta |
| 15 |
\def\marg##1{{\normalfont\ltxdoc@marg{##1}}}% |
| 16 |
\def\oarg##1{{\normalfont\ltxdoc@oarg{##1}}}% |
| 17 |
\def\parg##1{{\normalfont\ltxdoc@parg{##1}}}% |
| 18 |
\def\meta##1{{\normalfont\ltxdoc@meta{##1}}}% |
| 19 |
\pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\addplot\ }}% |
| 20 |
\declare{\texttt{#2}} \texttt{#3;}}% |
| 21 |
\unskip |
| 22 |
\nobreak |
| 23 |
\pgfmanualentryheadline{\textcolor{gray}{{\texttt{\char`\\addplot}\oarg{style options} \texttt{plot}\oarg{behavior options}}\ }% |
| 24 |
\declare{\texttt{#2}} \texttt{#3} \textcolor{gray}{\meta{trailing path commands}}\texttt{;}}% |
| 25 |
\def\pgfmanualtest{#1}% |
| 26 |
\ifx\pgfmanualtest\@empty% |
| 27 |
\index{#2@\protect\textcolor{gray}{\protect\texttt{plot}}\protect\texttt{ #2}}% |
| 28 |
\index{Plot operations!plot #2@\protect\texttt{plot #2}}% |
| 29 |
\fi% |
| 30 |
}% |
| 31 |
\pgfmanualbody |
| 32 |
} |
| 33 |
{ |
| 34 |
\end{pgfmanualentry} |
| 35 |
} |
| 36 |
|
| 37 |
\newenvironment{codekey}[1]{% |
| 38 |
\begin{pgfmanualentry} |
| 39 |
\pgfmanualentryheadline{{\ttfamily\declare{#1}\textcolor{gray}{/.code}=\marg{...}}\hfill}% |
| 40 |
\def\mykey{#1}% |
| 41 |
\def\mypath{}% |
| 42 |
\def\myname{}% |
| 43 |
\firsttimetrue% |
| 44 |
\decompose#1/\nil% |
| 45 |
\pgfmanualbody |
| 46 |
} |
| 47 |
{ |
| 48 |
\end{pgfmanualentry} |
| 49 |
} |
| 50 |
|
| 51 |
\newenvironment{pgfplotscodekey}[1]{% |
| 52 |
\begin{codekey}{/pgfplots/#1}% |
| 53 |
} |
| 54 |
{ |
| 55 |
\end{codekey} |
| 56 |
} |
| 57 |
\newenvironment{pgfplotscodetwokey}[1]{% |
| 58 |
\begin{pgfmanualentry} |
| 59 |
\pgfmanualentryheadline{{\ttfamily\declare{/pgfplots/#1}\textcolor{gray}{/.code 2 args}=\marg{...}}\hfill}% |
| 60 |
\def\mykey{/pgfplots/#1}% |
| 61 |
\def\mypath{}% |
| 62 |
\def\myname{}% |
| 63 |
\firsttimetrue% |
| 64 |
\decompose/pgfplots/#1/\nil% |
| 65 |
\pgfmanualbody |
| 66 |
} |
| 67 |
{ |
| 68 |
\end{pgfmanualentry} |
| 69 |
} |
| 70 |
|
| 71 |
\newenvironment{pgfplotsxycodekeylist}[1]{% |
| 72 |
\begingroup |
| 73 |
\let\oldpgfmanualentryheadline=\pgfmanualentryheadline |
| 74 |
\def\pgfmanualentryheadline##1{% |
| 75 |
\pgfmanualentryheadline@##1\pgfplots@EOI |
| 76 |
}% |
| 77 |
\def\pgfmanualentryheadline@##1\hfill##2\pgfplots@EOI{% |
| 78 |
\oldpgfmanualentryheadline{{\ttfamily\declare{##1}\textcolor{gray}{/.code}=\marg{...}}\hfill}% |
| 79 |
} |
| 80 |
\begin{pgfplotsxykeylist}{#1}% |
| 81 |
} |
| 82 |
{ |
| 83 |
\end{pgfplotsxykeylist} |
| 84 |
\endgroup |
| 85 |
} |
| 86 |
|
| 87 |
\newenvironment{pgfplotskey}[1]{% |
| 88 |
\begin{key}{/pgfplots/#1}% |
| 89 |
} |
| 90 |
{ |
| 91 |
\end{key} |
| 92 |
} |
| 93 |
|
| 94 |
\def\choicesep{$\vert$}% |
| 95 |
\def\choicearg#1{\texttt{#1}} |
| 96 |
|
| 97 |
\newif\iffirstchoice |
| 98 |
\newcommand\mchoice[1]{% |
| 99 |
\begingroup |
| 100 |
\firstchoicetrue |
| 101 |
\foreach \mchoice@ in {#1} {% |
| 102 |
\iffirstchoice |
| 103 |
\global\firstchoicefalse |
| 104 |
\else |
| 105 |
\choicesep |
| 106 |
\fi |
| 107 |
\choicearg{\mchoice@}% |
| 108 |
}% |
| 109 |
\endgroup |
| 110 |
}% |
| 111 |
|
| 112 |
% \begin{xykey}{/path/\x label=value} |
| 113 |
% \end{xykey} |
| 114 |
% |
| 115 |
% has same features with 'default', 'initially' etc as key environment |
| 116 |
\newenvironment{xykey}[2][]{% |
| 117 |
\begin{pgfmanualentry} |
| 118 |
\def\extrakeytext{} |
| 119 |
\insertpathifneeded{#2}{#1}% |
| 120 |
\expandafter\pgfutil@in@\expandafter=\expandafter{\mykey}% |
| 121 |
\ifpgfutil@in@% |
| 122 |
\expandafter\xykey@eq\mykey\@nil |
| 123 |
\else |
| 124 |
\expandafter\xykey@noeq\mykey\@nil |
| 125 |
\fi |
| 126 |
\pgfmanualbody |
| 127 |
}{% |
| 128 |
\end{pgfmanualentry} |
| 129 |
}% |
| 130 |
|
| 131 |
% \begin{xystylekey}{/path/\x label=value} |
| 132 |
% \end{xystylekey} |
| 133 |
% |
| 134 |
% has same features with 'default', 'initially' etc as key environment |
| 135 |
\newenvironment{xystylekey}[2][]{% |
| 136 |
\begin{pgfmanualentry} |
| 137 |
\def\extrakeytext{style, } |
| 138 |
\insertpathifneeded{#2}{#1}% |
| 139 |
\expandafter\pgfutil@in@\expandafter=\expandafter{\mykey}% |
| 140 |
\ifpgfutil@in@% |
| 141 |
\expandafter\xykey@eq\mykey\@nil |
| 142 |
\else |
| 143 |
\expandafter\xykey@noeq\mykey\@nil |
| 144 |
\fi |
| 145 |
\pgfmanualbody |
| 146 |
}{% |
| 147 |
\end{pgfmanualentry} |
| 148 |
}% |
| 149 |
|
| 150 |
% \insertpathifneeded{a key}{/pgfplots} -> assign mykey={/pgfplots/a key} |
| 151 |
% \insertpathifneeded{/tikz/a key}{/pgfplots} -> assign mykey={/tikz/a key} |
| 152 |
% |
| 153 |
% #1: the key |
| 154 |
% #2: a default path (or empty) |
| 155 |
\def\insertpathifneeded#1#2{% |
| 156 |
\def\insertpathifneeded@@{#2}% |
| 157 |
\ifx\insertpathifneeded@@\empty |
| 158 |
\def\mykey{#1}% |
| 159 |
\else |
| 160 |
\insertpathifneeded@#2\@nil |
| 161 |
\ifpgfutil@in@ |
| 162 |
\def\mykey{#2/#1}% |
| 163 |
\else |
| 164 |
\def\mykey{#1}% |
| 165 |
\fi |
| 166 |
\fi |
| 167 |
}% |
| 168 |
\def\insertpathifneeded@#1#2\@nil{% |
| 169 |
\def\insertpathifneeded@@{#1}% |
| 170 |
\def\insertpathifneeded@@@{/}% |
| 171 |
\ifx\insertpathifneeded@@\insertpathifneeded@@@ |
| 172 |
\pgfutil@in@true |
| 173 |
\else |
| 174 |
\pgfutil@in@false |
| 175 |
\fi |
| 176 |
}% |
| 177 |
|
| 178 |
% \begin{keylist}[default path] |
| 179 |
% {/path/option 1=value,/path/option 2=value2} |
| 180 |
% \end{keylist} |
| 181 |
\newenvironment{keylist}[2][]{% |
| 182 |
\begin{pgfmanualentry} |
| 183 |
\def\extrakeytext{}% |
| 184 |
\foreach \xx in {#2} {% |
| 185 |
\expandafter\insertpathifneeded\expandafter{\xx}{#1}% |
| 186 |
\expandafter\extractkey\mykey\@nil% |
| 187 |
}% |
| 188 |
\pgfmanualbody |
| 189 |
}{% |
| 190 |
\end{pgfmanualentry} |
| 191 |
}% |
| 192 |
|
| 193 |
\newenvironment{pgfplotskeylist}[1]{% |
| 194 |
\begin{keylist}[/pgfplots]{#1}% |
| 195 |
}{% |
| 196 |
\end{keylist}% |
| 197 |
} |
| 198 |
|
| 199 |
% \begin{xykeylist}[default path] |
| 200 |
% {/path/option \x1=value,/path/option \x2=value2,/path/option \x3=value} |
| 201 |
% \end{xykeylist} |
| 202 |
\newenvironment{xykeylist}[2][]{% |
| 203 |
\begin{pgfmanualentry} |
| 204 |
\def\extrakeytext{} |
| 205 |
\foreach \xx in {#2} {% |
| 206 |
\expandafter\insertpathifneeded\expandafter{\xx}{#1}% |
| 207 |
\expandafter\pgfutil@in@\expandafter=\expandafter{\mykey}% |
| 208 |
\ifpgfutil@in@% |
| 209 |
\expandafter\xykey@eq\mykey\@nil |
| 210 |
\else |
| 211 |
\expandafter\xykey@noeq\mykey\@nil |
| 212 |
\fi |
| 213 |
}% |
| 214 |
\pgfmanualbody |
| 215 |
}{% |
| 216 |
\end{pgfmanualentry} |
| 217 |
}% |
| 218 |
|
| 219 |
\newif\ifxykeyfound |
| 220 |
|
| 221 |
\def\xykey@eq#1=#2\@nil{% |
| 222 |
\def\x{x}% |
| 223 |
\xdef\mykey{#1}% |
| 224 |
\def\xykey@@{#1}% |
| 225 |
\ifx\xykey@@\mykey |
| 226 |
\xykeyfoundfalse |
| 227 |
\else |
| 228 |
\xykeyfoundtrue |
| 229 |
\fi |
| 230 |
\expandafter\extractkey\mykey=#2\@nil% |
| 231 |
\ifxykeyfound |
| 232 |
\def\x{y}% |
| 233 |
\xdef\mykey{#1}% |
| 234 |
\expandafter\extractkey\mykey=#2\@nil% |
| 235 |
\fi |
| 236 |
} |
| 237 |
\def\xykey@noeq#1\@nil{% |
| 238 |
\def\x{x}% |
| 239 |
\xdef\mykey{#1}% |
| 240 |
\def\xykey@@{#1}% |
| 241 |
\ifx\xykey@@\mykey |
| 242 |
\xykeyfoundfalse |
| 243 |
\else |
| 244 |
\xykeyfoundtrue |
| 245 |
\fi |
| 246 |
\expandafter\extractkey\mykey\@nil% |
| 247 |
\ifxykeyfound |
| 248 |
\def\x{y}% |
| 249 |
\xdef\mykey{#1}% |
| 250 |
\expandafter\extractkey\mykey\@nil% |
| 251 |
\fi |
| 252 |
} |
| 253 |
|
| 254 |
% \begin{pgfplotsxykey}{\x label=value} |
| 255 |
% \end{pgfplotsxykey} |
| 256 |
% |
| 257 |
% It introduces the path /pgfplots/ automatically. |
| 258 |
% |
| 259 |
% has same features with 'default', 'initially' etc as key environment |
| 260 |
\newenvironment{pgfplotsxykey}[1]{% |
| 261 |
\begin{xykey}[/pgfplots]{#1}% |
| 262 |
}{% |
| 263 |
\end{xykey}% |
| 264 |
} |
| 265 |
|
| 266 |
|
| 267 |
\newenvironment{pgfplotsxykeylist}[1]{% |
| 268 |
\begin{xykeylist}[/pgfplots]{#1}% |
| 269 |
}{% |
| 270 |
\end{xykeylist}% |
| 271 |
} |
| 272 |
|
| 273 |
|
| 274 |
\newenvironment{plottype}[1]{% |
| 275 |
\begin{key}{/tikz/#1}% |
| 276 |
\end{key} |
| 277 |
\begin{pgfmanualentry} |
| 278 |
\pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\addplot+[\declare{#1}]}}}% |
| 279 |
\pgfmanualbody |
| 280 |
} |
| 281 |
{ |
| 282 |
\end{pgfmanualentry} |
| 283 |
} |
| 284 |
|
| 285 |
\def\index@prologue{\section*{Index}\addcontentsline{toc}{section}{Index} |
| 286 |
} |
| 287 |
|
| 288 |
\newenvironment{pgfplotstablecolumnkey}{% |
| 289 |
\begin{pgfmanualentry} |
| 290 |
\pgfmanualentryheadline{{\ttfamily\textcolor{gray}{/pgfplots/table/}\declare{columns/\meta{column name}}\textcolor{gray}{/.style}=\marg{key-value-list}}\hfill}% |
| 291 |
\pgfplotsmanualkeyindex{/pgfplots/table/columns}% |
| 292 |
\pgfmanualbody |
| 293 |
} |
| 294 |
{ |
| 295 |
\end{pgfmanualentry} |
| 296 |
} |
| 297 |
\newenvironment{pgfplotstabledisplaycolumnkey}{% |
| 298 |
\begin{pgfmanualentry} |
| 299 |
\pgfmanualentryheadline{{\ttfamily\textcolor{gray}{/pgfplots/table/}\declare{display columns/\meta{index}}\textcolor{gray}{/.style}=\marg{key-value-list}}\hfill}% |
| 300 |
\pgfplotsmanualkeyindex{/pgfplots/table/display columns}% |
| 301 |
\pgfmanualbody |
| 302 |
} |
| 303 |
{ |
| 304 |
\end{pgfmanualentry} |
| 305 |
} |
| 306 |
\newenvironment{pgfplotstablealiaskey}{% |
| 307 |
\begin{pgfmanualentry} |
| 308 |
\pgfmanualentryheadline{{\ttfamily\textcolor{gray}{/pgfplots/table/}\declare{alias/\meta{col name}}\textcolor{gray}{/.initial}=\marg{real col name}}\hfill}% |
| 309 |
\pgfplotsmanualkeyindex{/pgfplots/table/alias}% |
| 310 |
\pgfmanualbody |
| 311 |
} |
| 312 |
{ |
| 313 |
\end{pgfmanualentry} |
| 314 |
} |
| 315 |
|
| 316 |
|
| 317 |
\def\pgfplotsmanualkeyindex#1{% |
| 318 |
\def\mypath{#1}% |
| 319 |
\def\myname{}% |
| 320 |
\firsttimetrue% |
| 321 |
\decompose#1/\nil% |
| 322 |
} |
| 323 |
\newenvironment{pgfplotstablecreateonusekey}{% |
| 324 |
\begin{pgfmanualentry} |
| 325 |
\pgfmanualentryheadline{{\ttfamily\textcolor{gray}{/pgfplots/table/}\declare{create on use/\meta{col name}}\textcolor{gray}{/.style}=\marg{create options}}\hfill}% |
| 326 |
\def\mykey{/pgfplots/table/create on use}% |
| 327 |
\pgfmanualbody |
| 328 |
\pgfplotsmanualkeyindex{/pgfplots/table/create on use}% |
| 329 |
} |
| 330 |
{ |
| 331 |
\end{pgfmanualentry} |
| 332 |
} |
| 333 |
|
| 334 |
\def\pgfplotsassertcmdkeyexists#1{% |
| 335 |
\pgfkeysifdefined{/pgfplots/#1/.@cmd}\relax{% |
| 336 |
\pgfplots@error{DOCUMENTATION ERROR: command key /pgfplots/#1 does not exist!}% |
| 337 |
}% |
| 338 |
}% |
| 339 |
|
| 340 |
{ |
| 341 |
\catcode`\ =12% |
| 342 |
\gdef\makespaceexpandable{\def\ { }}}% |
| 343 |
|
| 344 |
\def\pgfplotsassertXYcmdkeyexists#1{% |
| 345 |
{\makespaceexpandable\def\x{x}\edef\pgfplotsassertXYcmdkeyexists@tmp{#1}% |
| 346 |
\pgfkeysifdefined{/pgfplots/\pgfplotsassertXYcmdkeyexists@tmp/.@cmd}\relax{% |
| 347 |
\pgfplots@error{DOCUMENTATION ERROR: command key /pgfplots/#1 does not exist!}% |
| 348 |
}}% |
| 349 |
{\makespaceexpandable\def\x{y}\edef\pgfplotsassertXYcmdkeyexists@tmp{#1}% |
| 350 |
\pgfkeysifdefined{/pgfplots/\pgfplotsassertXYcmdkeyexists@tmp/.@cmd}\relax{% |
| 351 |
\pgfplots@error{DOCUMENTATION ERROR: command key /pgfplots/#1 does not exist!}% |
| 352 |
}}% |
| 353 |
}% |
| 354 |
|
| 355 |
\def\pgfplotsshortstylekey #1=#2;{% |
| 356 |
\pgfplotsassertcmdkeyexists{#1}% |
| 357 |
\pgfplotsassertcmdkeyexists{#2}% |
| 358 |
\begin{pgfplotskey}{#1=\marg{key-value-list}} |
| 359 |
An abbreviation for \texttt{#2/.append style=}\marg{key-value-list}. |
| 360 |
\end{pgfplotskey} |
| 361 |
} |
| 362 |
\def\pgfplotsshortxystylekey #1=#2;{% |
| 363 |
\pgfplotsassertXYcmdkeyexists{#1}% |
| 364 |
\pgfplotsassertXYcmdkeyexists{#2}% |
| 365 |
\begin{pgfplotsxykey}{#1=\marg{key-value-list}} |
| 366 |
An abbreviation for {\def\x{x}\texttt{#2/.append style=}}\marg{key-value-list} (or the respective style for $y$, {\def\x{y}\texttt{#2}}). |
| 367 |
\end{pgfplotsxykey} |
| 368 |
} |
| 369 |
\def\pgfplotsshortstylekeys #1,#2=#3;{% |
| 370 |
\pgfplotsassertcmdkeyexists{#1}% |
| 371 |
\pgfplotsassertcmdkeyexists{#2}% |
| 372 |
\pgfplotsassertcmdkeyexists{#3}% |
| 373 |
\begin{pgfplotskeylist}{% |
| 374 |
#1=\marg{key-value-list}, |
| 375 |
#2=\marg{key-value-list}} |
| 376 |
Different abbreviations for \texttt{#3/.append style=}\marg{key-value-list}. |
| 377 |
\end{pgfplotskeylist} |
| 378 |
} |
| 379 |
\def\pgfplotsshortxystylekeys #1,#2=#3;{% |
| 380 |
\pgfplotsassertXYcmdkeyexists{#1}% |
| 381 |
\pgfplotsassertXYcmdkeyexists{#2}% |
| 382 |
\pgfplotsassertXYcmdkeyexists{#3}% |
| 383 |
\begin{pgfplotsxykeylist}{% |
| 384 |
#1=\marg{key-value-list}, |
| 385 |
#2=\marg{key-value-list}} |
| 386 |
Different abbreviations for {\def\x{x}\texttt{#3/.append style=}}\marg{key-value-list} (or the respective style for $y$, {\def\x{y}\texttt{#3}}). |
| 387 |
\end{pgfplotsxykeylist} |
| 388 |
} |
| 389 |
|
| 390 |
\makeatother |