summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-06-15 17:56:37 +0000
committerKarl Berry <karl@freefriends.org>2008-06-15 17:56:37 +0000
commit3f126e90ac9efa15e72c8b415a2f25d3b19c509a (patch)
tree3fb6f3eebbf51978c31e8d6ff1180432e50b9935 /Master/texmf-dist/tex/generic/pgfplots
parent9667a29e9fef0ef89c9d7bd311e2d2a6aaccf50c (diff)
painful pgfplots update (14jun08)
git-svn-id: svn://tug.org/texlive/trunk@8751 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsarray.code.tex202
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex256
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex1007
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.coltype.code.tex85
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex12
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex96
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex927
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex922
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex2007
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots/pgfplots.code.tex5918
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots/pgfplots.stackedplots.code.tex365
11 files changed, 11797 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsarray.code.tex b/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsarray.code.tex
new file mode 100644
index 00000000000..16e4b539c02
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsarray.code.tex
@@ -0,0 +1,202 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This is a helper package with an elementary array datastructure,
+% featuring O(1) index access and O(N) creation, deletion, copy.
+%
+% The following macros are supplied:
+%
+% \pgfplotsarraynewempty
+% \pgfplotsarraynew
+% \pgfplotsarraycopy
+% \pgfplotsarraypushback
+% \pgfplotsarraysize
+% \pgfplotsarrayselect
+% \pgfplotsarrayletentry
+% \pgfplotsarraycheckempty
+% \pgfplotsarrayforeach
+%
+% Copyright 2007/2008 by Christian Feuersänger.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcount\c@pgfplotsarray@tmp
+\newif\ifpgfplotsarrayempty
+
+% Creates a new, empty array.
+\long\def\pgfplotsarraynewempty#1{%
+ \pgfplotsarray@@def{#1@size}{0}%
+}
+
+% Creates a new array with an abirtrary number of elements.
+% Arguments:
+% #1: the array's name (a macro name)
+% #2: the elements in the form
+% first\\second\\third\\ ...\\
+% like in tabular with one column.
+%
+% Example:
+% \pgfplotsarraynew\fooarray{First Element\\Second Element\\Third Element\\}
+%
+% WARNING: do NOT forget the final '\\'!
+\long\def\pgfplotsarraynew#1#2{%
+ \pgfplotsarraynewempty{#1}%
+ \long\def\pgfplotsarraynew@impl@rest{#2}%
+ \loop
+ \ifx\pgfplotsarraynew@impl@rest\pgfutil@empty
+ \pgfplots@loop@CONTINUEfalse
+ \else
+ \pgfplots@loop@CONTINUEtrue
+ \fi
+ \ifpgfplots@loop@CONTINUE
+ \expandafter\pgfplotsarraynew@impl\pgfplotsarraynew@impl@rest\toarray#1\relax
+ \repeat
+}
+
+% helper macro for \pgfplotsarraynew
+\long\def\pgfplotsarraynew@impl#1\\#2\toarray#3{%
+ \pgfplotsarraypushback#1\to#3\relax%
+ \def\pgfplotsarraynew@impl@rest{#2}%
+}
+
+
+\def\pgfplotsarray@@let#1=#2{%
+ \def\pgfplotsarray@TMP@@{\expandafter\let\csname\string#1\endcsname}%
+ \expandafter\pgfplotsarray@TMP@@\expandafter=\csname\string#2\endcsname
+}%
+
+\def\pgfplotsarray@@def#1{%
+ \expandafter\def\csname\string#1\endcsname
+}%
+\def\pgfplotsarray@@edef#1{%
+ \expandafter\edef\csname\string#1\endcsname
+}%
+
+\def\pgfplotsarray@@getsizeto#1#2{%
+ \pgfplotsarraysize{#1}\to\c@pgfplotsarray@tmp
+ \edef#2{\the\c@pgfplotsarray@tmp}%
+}%
+
+% Copies array #1 to array #2.
+\def\pgfplotsarraycopy#1\to#2{%
+ \pgfplotsarray@@let{#2@size}={#1@size}%
+ \pgfplotsarray@@getsizeto{#1}{\pgfplotsarray@TMP}%
+ \c@pgfplotsarray@tmp=0
+ \loop
+ \ifnum\c@pgfplotsarray@tmp<\pgfplotsarray@TMP
+ \pgfplotsarray@@let{#2@\the\c@pgfplotsarray@tmp}={#1@\the\c@pgfplotsarray@tmp}%
+ \advance\c@pgfplotsarray@tmp by1
+ \repeat
+}
+
+
+
+% #1: the item to append
+% #2: the array as macro name
+% Example:
+% \pgfplotsarraypushback Next last element\to\fooarray
+\long\def\pgfplotsarraypushback#1\to#2{%
+ \pgfplotsarraysize{#2}\to\c@pgfplotsarray@tmp
+ \pgfplotsarray@@def{#2@\the\c@pgfplotsarray@tmp}{#1}%
+ \advance\c@pgfplotsarray@tmp by1
+ \pgfplotsarray@@edef{#2@size}{\the\c@pgfplotsarray@tmp}%
+}
+
+
+% Counts the number of elements in array #1, storing it into the count
+% register #2.
+% Example:
+% \pgfplotsarraysize\foo\to{\count0}%
+% \the\count0
+\long\def\pgfplotsarraysize#1\to#2{%
+ #2=\csname\string#1@size\endcsname\relax
+}
+
+% Returns the #1th element of array #2 into macro #3
+% Arguments:
+% #1: a count 0,...,N-1 where N is the array size.
+% You may specify a number of a count.
+% #2: a array
+% #3: a macro name
+% Example:
+% Element 0:
+% \pgfplotsarrayselect0\of\foo\to\elem
+% \elem
+% Element \count1:
+% \pgfplotsarrayselect\count1\of\foo\to\elem
+\long\def\pgfplotsarrayselect#1\of#2\to#3{%
+ \c@pgfplotsarray@tmp=#1\relax
+ \expandafter\let\expandafter#3\expandafter=\csname\string#2@\the\c@pgfplotsarray@tmp\endcsname%
+}
+\long\def\pgfplotsarrayletentry#1\of#2=#3{%
+ \c@pgfplotsarray@tmp=#1\relax
+ \expandafter\let\csname\string#2@\the\c@pgfplotsarray@tmp\endcsname=#3\relax
+}
+
+% Sets the boolean \ifpgfplotsarrayempty depending on whether array #1 is empty
+% or not.
+% Example:
+%
+% \pgfplotsarraycheckempty\fooarray
+% \ifpgfplotsarrayempty
+% List fooarray is empty!
+% \else
+% List is not empty.
+% \fi
+\def\pgfplotsarraycheckempty#1{%
+ \pgfplotsarraysize{#1}\to\c@pgfplotsarray@tmp
+ \ifnum\c@pgfplotsarray@tmp=0\relax
+ \pgfplotsarrayemptytrue
+ \else
+ \pgfplotsarrayemptyfalse
+ \fi
+}
+
+
+% Iterates through each array element, names it #2 and calls code #3.
+% Example:
+% \pgfplotsarraynew\fooarray{Eins\\Zwei\\Drei\\}%
+% \pgfplotsarrayforeach\fooarray\as\foo{Element \foo\par}%
+% results in
+% Element Eins
+% Element Zwei
+% Element Drei
+% Each single element will be grouped with TeX groups.
+\long\def\pgfplotsarrayforeach#1\as#2#3{%
+ \pgfplotsarray@@getsizeto{#1}{\pgfplotsarray@TMP}%
+ \c@pgfplotsarray@tmp=0\relax
+ \loop
+ \ifnum\c@pgfplotsarray@tmp<\pgfplotsarray@TMP\relax
+ \begingroup
+ \expandafter\let\expandafter#2\expandafter=\csname\string#1@\the\c@pgfplotsarray@tmp\endcsname%
+ #3%
+ \endgroup
+ \advance\c@pgfplotsarray@tmp by1
+ \repeat
+}
+
+% The same but without groups around #3.
+\long\def\pgfplotsarrayforeachungrouped#1\as#2#3{%
+ \pgfplotsarray@@getsizeto{#1}{\pgfplotsarray@TMP}%
+ \c@pgfplotsarray@tmp=0\relax
+ \loop
+ \ifnum\c@pgfplotsarray@tmp<\pgfplotsarray@TMP\relax
+ \expandafter\let\expandafter#2\expandafter=\csname\string#1@\the\c@pgfplotsarray@tmp\endcsname%
+ #3%
+ \advance\c@pgfplotsarray@tmp by1
+ \repeat
+}
diff --git a/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex b/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex
new file mode 100644
index 00000000000..48fd19a890c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex
@@ -0,0 +1,256 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% This is a helper package with an elementary list datastructure.
+%
+% Its implementation is based on Knuth's list macros in "The TeXbook".
+%
+% The following macros are supplied:
+%
+% \pgfplotslistnewempty
+% \pgfplotslistnew
+% \pgfplotslistcopy
+% \pgfplotslistpopfront
+% \pgfplotslistpushback
+% \pgfplotslistpushfront
+% \pgfplotslistsize
+% \pgfplotslistselect
+% \pgfplotslistcheckempty
+% \pgfplotslistforeach
+%
+% Copyright 2007/2008 by Christian Feuersänger.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newtoks\pgfplotslist@TOK@a
+\newtoks\pgfplotslist@TOK@b
+\newif\ifpgfplotslistempty
+
+
+\newif\ifpgfplots@loop@CONTINUE
+\newif\ifpgfplotslist@is@backslash@terminated
+
+% Creates a new, empty list.
+\long\def\pgfplotslistnewempty#1{\let#1=\pgfutil@empty}
+
+% Creates a new list with an abirtrary number of elements.
+% Arguments:
+% #1: the list's name (a macro name)
+% #2: the elements in the form
+% first\\second\\third\\ ...\\
+% like in tabular with one column.
+% You can also use comma-separated lists
+% first,second,third
+%
+% Example:
+% 1.
+% \pgfplotslistnew\foolist{First Element\\Second Element\\Third Element\\}
+% WARNING: do NOT forget the final '\\'!
+%
+% 2.
+% \pgfplotslistnew\foolist{First Element,Second Element,Third Element}
+%
+% Use braces '{}' to use '\\' or ',' as arguments.
+%
+\long\def\pgfplotslistnew#1#2{%
+ \pgfplotslistnewempty{#1}%
+ \long\def\pgfplotslistnew@impl@rest{#2}%
+ \pgfplotslist@check@backslash@list #2\\\pgfplotslist@EOI
+ \ifpgfplotslist@is@backslash@terminated
+ \else
+ \expandafter\def\expandafter\pgfplotslistnew@impl@rest\expandafter{\pgfplotslistnew@impl@rest,}%
+ \fi
+ \loop
+ \ifx\pgfplotslistnew@impl@rest\pgfutil@empty
+ \pgfplots@loop@CONTINUEfalse
+ \else
+ \pgfplots@loop@CONTINUEtrue
+ \fi
+ \ifpgfplots@loop@CONTINUE
+ \ifpgfplotslist@is@backslash@terminated
+ \expandafter\pgfplotslistnew@impl\pgfplotslistnew@impl@rest\tolist#1\relax
+ \else
+ \expandafter\pgfplotslistnew@impl@comma\pgfplotslistnew@impl@rest\tolist#1\relax
+ \fi
+ \repeat
+}
+\def\pgfplotslist@EOI{\pgfplotslist@EOI}
+
+\def\pgfplotslist@check@backslash@list#1\\#2\pgfplotslist@EOI{%
+ \def\pgfplotslist@TMPB{#2}%
+ \ifx\pgfplotslist@TMPB\pgfutil@empty
+ \pgfplotslist@is@backslash@terminatedfalse
+ \else
+ \pgfplotslist@is@backslash@terminatedtrue
+ \fi
+}%
+
+% Copies list #1 to list #2.
+\def\pgfplotslistcopy#1\to#2{\let#2=#1}
+
+
+% helper macro for \pgfplotslistnew
+\long\def\pgfplotslistnew@impl#1\\#2\tolist#3{%
+ \pgfplotslistpushback#1\to#3\relax%
+ \def\pgfplotslistnew@impl@rest{#2}%
+}
+\long\def\pgfplotslistnew@impl@comma#1,#2\tolist#3{%
+ \pgfplotslistpushback#1\to#3\relax%
+ \def\pgfplotslistnew@impl@rest{#2}%
+}
+
+
+% #1: the item to prepend
+% #2: the list as macro name
+% Example:
+% \pgfplotslistpushfront Next first Element\to\foolist
+\long\def\pgfplotslistpushfront#1\to#2{%
+ \pgfplotslist@TOK@a={\pgfplotslist@sep{#1}}%
+ \pgfplotslist@TOK@b=\expandafter{#2}%
+ \edef#2{\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+}
+
+% #1: the item to append
+% #2: the list as macro name
+% Example:
+% \pgfplotslistpushback Next last element\to\foolist
+\long\def\pgfplotslistpushback#1\to#2{%
+ \pgfplotslist@TOK@a={\pgfplotslist@sep{#1}}%
+ \ifx#2\pgfutil@empty
+ \pgfplotslist@TOK@b={}%
+ \else
+ \pgfplotslist@TOK@b=\expandafter{#2}%
+ \fi
+ \edef#2{\the\pgfplotslist@TOK@b\the\pgfplotslist@TOK@a}%
+}
+
+% Concatenates two lists #2 and #3 into #1
+% Example:
+% \pgfplotslistconcat\result=\foolist&\bar
+\long\def\pgfplotslistconcat#1=#2&#3{%
+ \pgfplotslist@TOK@a=\expandafter{#2}%
+ \pgfplotslist@TOK@b=\expandafter{#3}%
+ \edef#1{\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+}
+
+% implements #2 := pop_front(#1)
+% Example:
+% \pgfplotslistpopfront\foolist\to\poppedfirstelem
+\long\def\pgfplotslistpopfront#1\to#2{%
+ \pgfplotslistcheckempty#1\relax
+ \ifpgfplotslistempty
+ \pgfplots@error{ERROR: \string\pgfplotslistpopfront\ from \string#1\ although list is EMPTY}%
+ \else
+ \expandafter\pgfplotslistpopfront@impl#1\pgfplotslistpopfront@macronames#1#2%
+ \fi
+}
+
+% implementation helper for listpopfront
+\long\def\pgfplotslistpopfront@impl\pgfplotslist@sep#1#2\pgfplotslistpopfront@macronames#3#4{%
+ \def#4{#1}%
+ \def#3{#2}%
+}
+
+% Counts the number of elements in list #1, storing it into the count
+% register #2.
+% Example:
+% \pgfplotslistsize\foo\to{\count0}%
+% \the\count0
+\long\def\pgfplotslistsize#1\to#2{%
+ #2=0%
+ \long\def\pgfplotslist@sep##1{\advance#2 by 1 }%
+ #1%
+}
+
+% Returns the #1th element of list #2 into macro #3
+% Arguments:
+% #1: a count 0,...,N-1 where N is the list size.
+% You may specify a number of a count.
+% #2: a list
+% #3: a macro name
+% Example:
+% Element 0:
+% \pgfplotslistselect0\of\foo\to\elem
+% \elem
+% Element \count1:
+% \pgfplotslistselect\count1\of\foo\to\elem
+\long\def\pgfplotslistselect#1\of#2\to#3{%
+ \global\def\pgfplotslistselect@tmp{\def#3{\pgfplots@error{The requested item #1 of \string#2 is OUT OF RANGE.}}}%
+ \begingroup
+ \count0=#1\relax
+ \long\def\pgfplotslist@sep##1{%
+ \advance\count0-1\relax
+ \ifnum\count0=-1\relax
+ \global\def\pgfplotslistselect@tmp{\def#3{##1}}%
+ \fi%
+ }%
+ #2%
+ \endgroup
+ \pgfplotslistselect@tmp
+}
+
+% Sets the boolean \ifpgfplotslistempty depending on whether list #1 is empty
+% or not.
+% Example:
+%
+% \pgfplotslistcheckempty\foolist
+% \ifpgfplotslistempty
+% List foolist is empty!
+% \else
+% List is not empty.
+% \fi
+\def\pgfplotslistcheckempty#1{%
+ \ifx#1\pgfutil@empty
+ \pgfplotslistemptytrue
+ \else
+ \pgfplotslistemptyfalse
+ \fi
+}
+
+
+% Iterates through each list element, names it #2 and calls code #3.
+% Example:
+% \pgfplotslistnew\foolist{Eins\\Zwei\\Drei\\}%
+% \pgfplotslistforeach\foolist\as\foo{Element \foo\par}%
+% results in
+% Element Eins
+% Element Zwei
+% Element Drei
+% Each single element will be grouped with TeX groups.
+\long\def\pgfplotslistforeach#1\as#2#3{%
+ \begingroup
+ \long\def\pgfplotslist@sep##1{\def#2{##1}%
+ \begingroup
+ #3
+ \endgroup}%
+ #1\relax
+ \endgroup
+}
+
+\newif\ifpgfplotslistforeachungroupedrunning
+
+% The same but without groups around #3.
+\long\def\pgfplotslistforeachungrouped#1\as#2#3{%
+ \ifpgfplotslistforeachungroupedrunning
+ \pgfplots@error{Sorry, you can't nest pgfplotslistforeachungrouped.}%
+ \else
+ \pgfplotslistforeachungroupedrunningtrue
+ \long\def\pgfplotslist@sep##1{\def#2{##1}#3}%
+ #1\relax
+ \pgfplotslistforeachungroupedrunningfalse
+ \fi
+}
diff --git a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
new file mode 100644
index 00000000000..82e27215bf4
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
@@ -0,0 +1,1007 @@
+%--------------------------------------------
+%
+% Package numtable
+%
+% Provides support to read and work with abstact numeric tables of the
+% form
+%
+% COLUMN1 COLUMN2 COLUMN3
+% 1 2 3
+% 4 4 552
+% 1e124 0.00001 1.2345e-12
+% ...
+%
+% Copyright 2007/2008 by Christian Feuersänger.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%--------------------------------------------
+
+% This file relies on
+% - pgfplotsliststructure.code.tex
+% - pgfplotsarraystructure.code.tex
+% - a (quite!) recent PGF.
+%
+% and needs some token registers. It does not use more of pgfplots.
+%
+\newif\ifpgfplotstable@search@header
+\newcount\c@pgfplotstable@counta
+\newwrite\pgfplotstable@outfile
+\newif\ifpgfplotstabletypesetdebug
+\newif\ifpgfplotstableuserow
+
+% should always be false; use only in grouped internal macros
+\newif\ifpgfplots@table@options@areset
+
+\input pgfplotstable.coltype.code.tex
+
+\pgfkeys{%
+ /pgfplots/table/header/.is if=pgfplotstable@search@header,
+ /pgfplots/table/header=true,
+ /pgfplots/table/x index/.store in=\pgfplots@plot@tbl@xindex,
+ /pgfplots/table/x index=0,
+ /pgfplots/table/x/.store in=\pgfplots@plot@tbl@x,
+ /pgfplots/table/x=,
+ /pgfplots/table/y index/.store in=\pgfplots@plot@tbl@yindex,
+ /pgfplots/table/y index=1,
+ /pgfplots/table/y/.store in=\pgfplots@plot@tbl@y,
+ /pgfplots/table/y=,
+ /pgfplots/table/x error index/.initial=,
+ /pgfplots/table/y error index/.initial=,
+ /pgfplots/table/x error/.initial=,
+ /pgfplots/table/y error/.initial=,
+ /pgfplots/table/row predicate/.code={},
+ /pgfplots/table/skip rows between index/.style 2 args={%
+ /pgfplots/table/row predicate/.append code={%
+ \ifnum##1<#1\relax
+ \else
+ \ifnum##1<#2\relax
+ \pgfplotstableuserowfalse
+ \fi
+ \fi}
+ },
+ /pgfplots/table/col sep/.is choice,
+ /pgfplots/table/col sep/space/.code = {\def\pgfplotstableread@COLSEP@CASE{0}},
+ /pgfplots/table/col sep/comma/.code = {\def\pgfplotstableread@COLSEP@CASE{1}},
+ /pgfplots/table/col sep/semicolon/.code = {\def\pgfplotstableread@COLSEP@CASE{2}},
+ /pgfplots/table/col sep/colon/.code = {\def\pgfplotstableread@COLSEP@CASE{3}},
+ /pgfplots/table/col sep/braces/.code = {\def\pgfplotstableread@COLSEP@CASE{4}},
+ /pgfplots/table/col sep=space,
+ % columns={name1,name2}
+ % or
+ % columns={[index]2,name2,name3,[index]5}
+ /pgfplots/table/columns/.initial=,
+ /pgfplots/table/column name/.initial=\pgfkeysnovalue,
+ %
+ % this thing here allows to MODIFY 'column name'.
+ %
+ % Argument #1 is the current column name, that means after
+ % evaluating 'column name'. If this key changes anything, it
+ % should write its result back into 'column name'.
+ %
+ % That means you can use 'column name' to assign the name as such
+ % and 'assign column name' to generate final TeX code (for example
+ % to insert \multicolumn{1}{c}{#1} or so).
+ % default is empty which means no change.
+ %/pgfplots/table/assign column name/.code={
+ % \pgfkeyssetvalue{/pgfplots/table/column name}{#1}%
+ %},
+ %
+ %
+ %
+ % A style which inserts \multicolumn{1}{#1}{<column name>} for
+ % each column name.
+ % The column name as such can be set with the 'column name' option.
+ /pgfplots/table/multicolumn names/.style={%
+ /pgfplots/table/assign column name/.code={%
+ \pgfkeyssetvalue{/pgfplots/table/column name}{\multicolumn{1}{#1}{##1}}%
+ }%
+ },
+ /pgfplots/table/multicolumn names/.default=c,
+ /pgfplots/table/dec sep align/.style={%
+ /pgf/number format/assume math mode,
+ /pgf/number format/set decimal separator/.add={&}{},
+ /pgfplots/table/assign column name/.code={%
+ \pgfkeyssetvalue{/pgfplots/table/column name}{\multicolumn{2}{#1}{##1}}%
+ },%
+ /pgfplots/table/column type={>{$}r<{$}@{}>{$}l<{$}},
+ /pgfplots/table/assign cell content/.code={%
+ \pgfmathprintnumberto{##1}\pgfmathresult%
+ \expandafter\pgfutil@in@\expandafter&\expandafter{\pgfmathresult}%
+ \ifpgfutil@in@
+ \else
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult&}%
+ \fi
+ \pgfkeyslet{/pgfplots/table/@cell content}\pgfmathresult
+ },
+ },
+ /pgfplots/table/dec sep align/.default=c,
+ %
+ % A style which can be used together with the 'dcolumn' package by
+ % David Carlisle.
+ % #1: the dcolumn type, defaults to 'D{.}{.}{2}'
+ % #2: the column name type, defaults to 'c'
+ /pgfplots/table/dcolumn/.style 2 args={%
+ /pgf/number format/assume math mode,
+ column type={#1},
+ multicolumn names=#2,
+ },
+ /pgfplots/table/dcolumn/.default={D{.}{.}{2}}{c},
+ /pgfplots/table/column type/.initial={c},
+ /pgfplots/table/every table/.style={},
+ /pgfplots/table/every even row/.style={},
+ /pgfplots/table/every odd row/.style={},
+ /pgfplots/table/every last row/.style={},
+ /pgfplots/table/every first row/.style={},
+ /pgfplots/table/every head row/.style={},
+ /pgfplots/table/every first column/.style={},
+ /pgfplots/table/every last column/.style={},
+ /pgfplots/table/every even column/.style={},
+ /pgfplots/table/every odd column/.style={},
+ /pgfplots/table/before row/.initial=,
+ /pgfplots/table/after row/.initial=,
+ /pgfplots/table/begin table/.initial={\begin{tabular}},
+ /pgfplots/table/end table/.initial={\end{tabular}},
+ /pgfplots/table/outfile/.initial=,
+ /pgfplots/table/debug/.is if=pgfplotstabletypesetdebug,
+ %
+ % will be redefined by |assign cell content| for every cell:
+ /pgfplots/table/@cell content/.initial=,
+ %
+ % #1: the cells content as it has been found in the input table
+ % this command key should somehow fill |cell content|.
+ /pgfplots/table/assign cell content/.code={%
+ \pgfmathprintnumberto{#1}\pgfmathresult%
+ \pgfkeyslet{/pgfplots/table/@cell content}\pgfmathresult
+ },
+ %
+ % this here is the default formatting. It uses
+ % \pgfmathprintnumber.
+ /pgfplots/table/assign cell content as number/.code={%
+ \pgfmathprintnumberto{#1}\pgfmathresult%
+ \pgfkeyslet{/pgfplots/table/@cell content}\pgfmathresult
+ },
+ /pgfplots/table/string type/.style={%
+ /pgfplots/table/assign cell content/.style={%
+ /pgfplots/table/@cell content={##1}%
+ }%
+ },%
+ /pgfplots/table/font/.initial=,
+ /pgfplots/table/.unknown/.code={%
+ \pgfqkeys{/pgf/number format}{\pgfkeyscurrentname=#1}%
+ }%
+}
+
+% \pgfplotstableread[OPTIONS] {FILE} to \name
+%
+% This method reads a table from FILE to macro \name.
+%
+% FILE is something like
+% G Basis dof L2 A Lmax cgiter maxlevel eps
+% 5 5 5 8.31160034e-02 0.00000000e+00 1.80007647e-01 2 2 -1
+% 17 17 17 2.54685628e-02 0.00000000e+00 3.75580565e-02 5 3 -1
+% ...
+%
+% A number format line is also understood:
+% G Basis dof L2 A Lmax cgiter maxlevel eps
+% $flags int int int sci:8 sci:8 sci:8 int int std:8
+% 5 5 5 8.31160034e-02 0.00000000e+00 1.80007647e-01 2 2 -1
+%
+% or a three-column-gnuplot file with 2 comment headers like
+% #Curve 0, 20 points
+% #x y type
+% 0.00000 0.00000 i
+% 0.52632 0.50235 i
+%
+% The table data is stored columnwise in lists and can be accessed
+% with the other methods of this package.
+\def\pgfplotstableread{%
+ \pgfutil@ifnextchar[{%
+ \pgfplotstableread@impl
+ }{%
+ \pgfplotstableread@impl[]%
+ }%
+}
+
+% BACKWARDS COMPATIBILITY
+\let\pgfnumtableread=\pgfplotstableread
+
+\def\pgfplotstablegetcolumnlist#1\to#2{%
+ \let#2=#1
+}
+
+\def\pgfplotstablegetcolumnbyname#1\of#2\to#3{%
+ \pgfutil@ifundefined{\string#2@#1}{%
+ \pgfplots@error{Sorry, could not retrieve column '#1' from table...}%
+ }{%
+ \expandafter\let\expandafter#3\csname\string#2@#1\endcsname
+ }%
+}
+
+\def\pgfplotstablegetcolumnnamebyindex#1\of#2\to#3{%
+ \pgfplotslistselect#1\of#2\to#3\relax
+}%
+\def\pgfplotstablegetcolumnbyindex#1\of#2\to#3{%
+ \pgfplotslistselect#1\of#2\to#3\relax
+ \expandafter\pgfplotstablegetcolumnbyname#3\of#2\to{#3}%
+}
+
+\def\pgfplotstablecopy#1\to#2{%
+ \let#2=#1%
+ \pgfplotslistforeachungrouped#1\as\pgfplotstable@TMP{%
+ \def\pgfplotstable@TMPB{%
+ \expandafter\let\csname\string#2@\pgfplotstable@TMP\endcsname}%
+ \expandafter\pgfplotstable@TMPB\csname\string#1@\pgfplotstable@TMP\endcsname
+ }%
+}
+
+% Typesets a table.
+%
+% \pgfplotstabletypeset[<options>]<\tablestructure>
+%
+% If you do not select any columns, the complete table is drawn.
+%
+% There are several options and styles which are available in
+% <options>, see the declaration above.
+%
+% ATTENTION: the default implementation employs
+% \begin{tabular}...\end{tabular} and is therefor only usable with
+% LaTeX!
+%
+% You will need to reconfigure the tables.
+%
+% Inside of \pgfplotstabletypeset, the macros \pgfplotstablecol and
+% \pgfplotstablerow will expand to the current column index and row
+% index.
+\def\pgfplotstabletypeset{%
+ \pgfutil@ifnextchar[{%
+ \pgfplotstabletypeset@opt
+ }{%
+ \pgfplotstabletypeset@opt[]%
+ }%
+}
+
+% Like \pgfplotstabletypeset, but the first argument is a file name.
+\def\pgfplotstabletypesetfile{%
+ \pgfutil@ifnextchar[{%
+ \pgfplotstabletypesetfile@opt
+ }{%
+ \pgfplotstabletypesetfile@opt[]%
+ }%
+}
+\def\pgfplotstabletypesetfile@opt[#1]#2{%
+ \begingroup
+ \ifpgfplots@table@options@areset
+ \else
+ \pgfplots@table@options@aresettrue
+ \pgfplotstableset{/pgfplots/table/every table,#1}%
+ \fi
+ \pgfplotstableread{#2}\pgfplotstabletypesetfile@opt@@
+ \pgfplotstabletypeset\pgfplotstabletypesetfile@opt@@
+ \endgroup
+}%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% IMPLEMENTATION
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newif\ifpgfplotstableread@curline@contains@colnames
+\newif\ifpgfplotstableread@foundcolnames
+\newif\ifpgfplotstableread@skipline
+\def\pgfplotstableread@impl[#1]#2{%
+ \pgfutil@ifnextchar t{%
+ \pgfplotstableread@impl@@{#1}{#2}%
+ }{%
+ \pgfplotstableread@impl@{#1}{#2}%
+ }%
+}%
+
+% I don't know why; but I started with
+% >> \pgfplotstableread[]{file} to \macro
+% That ' to ' is really ugly. This here is for backwards
+% compatibility:
+\def\pgfplotstableread@impl@@#1#2to #3{%
+ \pgfplotstableread@impl@{#1}{#2}{#3}%
+}%
+
+\def\pgfplotstableread@impl@#1#2#3{%
+ \begingroup
+ \ifpgfplots@table@options@areset
+ \else
+ \pgfplotstableset{/pgfplots/table/every table,#1}%
+ \fi
+%\pgfplots@message{ATTEMPTING TO READ #2}%
+ \openin1=#2\relax
+ \def\pgfplotstableread@filename{#2}%
+ \let\pgfplotstableread@lineno=\c@pgf@counta
+ \let\pgfplotstableread@numcols=\c@pgf@countb
+ \let\pgfplotstableread@curcol=\c@pgf@countc
+ \let\pgfplotstableread@usablelineno=\c@pgf@countd
+ \pgfplotstableread@lineno=0
+ \pgfplotstableread@usablelineno=0
+ \pgfplotstableread@numcols=0
+ \pgfplotslistnewempty\pgfplotstable@colnames
+ \ifeof1
+ \pgfplotstable@error{Could not read table file '#2'.}%
+ \fi
+ %
+ \pgfplotstableread@loop@over@lines
+ %
+ \ifpgfplotstableread@foundcolnames
+ \else
+ \pgfplotstableread@create@column@names@with@numbers
+ \fi
+ % Well, now write the identified data to #3:
+ %
+ % make all temporaries global:
+ \global\let\pgfplotstable@colnames=\pgfplotstable@colnames
+ \pgfplotstableread@curcol=0\relax
+ \loop
+ \ifnum\pgfplotstableread@curcol<\pgfplotstableread@numcols
+%\pgfplots@message{ASSIGNING COLUMN NO \the\pgfplotstableread@curcol / \the\pgfplotstableread@numcols}%
+ % numtable@TMP := column list content
+ \expandafter\global\expandafter\let\expandafter\pgfplotstable@TMP\csname numtable@col@\the\pgfplotstableread@curcol\endcsname
+ % global := numtable@TMP
+ \expandafter\global\expandafter\let\csname numtable@col@\the\pgfplotstableread@curcol\endcsname=\pgfplotstable@TMP
+ \advance\pgfplotstableread@curcol by1\relax
+ \repeat
+ \closein1
+ \endgroup
+ % Now, we can access the global variables!
+ % copy them to #3.
+ \let#3=\pgfplotstable@colnames
+ \c@pgfplotstable@counta=0\relax%
+ \pgfplotslistforeachungrouped\pgfplotstable@colnames\as\pgfplotstable@TMP{%
+ \def\pgfplotstable@TMPB{%
+ \expandafter\let\csname\string#3@\pgfplotstable@TMP\endcsname}%
+ \expandafter\pgfplotstable@TMPB\csname numtable@col@\the\c@pgfplotstable@counta\endcsname
+%\message{Column '\pgfplotstable@TMP' has entries: \expandafter\meaning\csname numtable@col@\the\c@pgfplotstable@counta\endcsname}%
+ \expandafter\global\expandafter\let\csname numtable@col@\the\c@pgfplotstable@counta\endcsname=\pgfutil@empty
+ \advance\c@pgfplotstable@counta by1\relax
+ }%
+ \global\let\pgfplotstable@colnames=\pgfutil@empty
+}
+
+\def\pgfplotstableread@loop@over@lines{%
+ \ifeof1
+%\pgfplots@message{EOF}%
+ \else
+ \read1 to\pgfplotstable@LINE
+ \ifeof1
+ \else
+ \expandafter\pgfplotstableread@checkspecial@line\pgfplotstable@LINE\pgfplotstable@EOI
+ \ifpgfplotstableread@skipline
+ \else
+ %--------------------------------------------------
+ % \ifnum\pgfplotstableread@lineno=0
+ % \let\pgfplotstable@firstline=\pgfplotstable@LINE
+ % \fi
+ %--------------------------------------------------
+%\pgfplots@message{READING LINE \the\pgfplotstableread@lineno: '\meaning\pgfplotstable@LINE'.}%
+ \ifnum\pgfplotstableread@numcols=0\relax
+ \pgfplotstableread@curcol=0\relax
+ \pgfplotstableread@curline@contains@colnamesfalse
+ \pgfplotstableread@impl@DO\pgfplotstableread@impl@countcols@and@identifynames@NEXT\pgfplotstable@LINE
+ %\expandafter\pgfplotstableread@impl@countcols@and@identifynames@ITERATE\pgfplotstable@LINE\pgfplotstable@EOI
+ \pgfplotstableread@numcols=\pgfplotstableread@curcol
+ \pgfplotstableread@curcol=0\relax
+ % Create empty column lists:
+ \pgfplotstableread@create@column@lists
+ %
+ \ifnum\pgfplotstableread@usablelineno=0\relax
+ \ifnum\pgfplotstableread@lineno=2\relax
+ \ifnum\pgfplotstableread@numcols=3\relax
+ % The file started with
+ % #...
+ % #...
+ % X Y i
+ % -> thats a gnuplot file!
+ \pgfplotstableread@curline@contains@colnamesfalse
+ \fi
+ \fi
+ \fi
+ % Now, read the first line.
+ % It contains either
+ % - column names,
+ % - numerical data,
+ % - nothing (comments).
+ \ifpgfplotstableread@curline@contains@colnames
+ \pgfplotstableread@foundcolnamestrue
+ \pgfplotstableread@curcol=0\relax
+ \pgfplotstableread@impl@DO\pgfplotstableread@impl@collectcolnames@NEXT\pgfplotstable@LINE
+ %\expandafter\pgfplotstableread@impl@collectcolnames@ITERATE\pgfplotstable@LINE\pgfplotstable@EOI
+ \else
+ \pgfplotstableread@foundcolnamesfalse
+ \pgfplotstableread@curcol=0\relax
+ % Leave column name lists empty...
+ \pgfplotstableread@impl@DO\pgfplotstableread@impl@nextrow@NEXT\pgfplotstable@LINE
+ %\expandafter\pgfplotstableread@impl@nextrow@ITERATE\pgfplotstable@LINE\pgfplotstable@EOI
+ \fi
+%\pgfplots@message{After reading first row: found '\the\pgfplotstableread@numcols' columns; column name list='\meaning\pgfplotstable@colnames'}%
+ \else
+ \pgfplotstableread@curcol=0\relax
+ \pgfplotstableread@impl@DO\pgfplotstableread@impl@nextrow@NEXT\pgfplotstable@LINE
+ %\expandafter\pgfplotstableread@impl@nextrow@ITERATE\pgfplotstable@LINE\pgfplotstable@EOI
+ \fi
+ \ifnum\pgfplotstableread@curcol=\pgfplotstableread@numcols
+ \else
+ \pgfplotstable@error{ERROR: the input table has an unexpected number of columns in row '\the\pgfplotstableread@lineno'. Expected: '\the\pgfplotstableread@numcols'; got '\the\pgfplotstableread@curcol. Maybe the input table is corrupted?}%
+ \fi
+ \advance\pgfplotstableread@usablelineno by1\relax
+ \fi
+ \fi
+ \advance\pgfplotstableread@lineno by1\relax
+ \pgfplotstableread@loop@over@lines
+ \fi
+}
+
+\def\pgfplotstableread@checkspecial@line{%
+ \pgfutil@ifnextchar##{%
+ \pgfplotstableread@skiplinetrue
+ \pgfplotstableread@impl@gobble
+ }{%
+ \pgfutil@ifnextchar${%
+ \pgfplotstableread@process@flags@line
+ }{%
+ \pgfutil@ifnextchar\pgfplotstable@EOI{%
+ \pgfplotstableread@skiplinetrue
+ \pgfplotstableread@impl@gobble
+ }{%
+ \pgfutil@ifnextchar\par{%
+ \pgfplotstableread@skiplinetrue
+ \pgfplotstableread@impl@gobble
+ }{%
+ \pgfplotstableread@skiplinefalse
+ \pgfplotstableread@impl@gobble
+ }%
+ }%
+ }%
+ }%
+}
+
+\long\def\pgfplotstableread@process@flags@line$flags {%
+%\pgfplots@message{Ignoring flags line ...}%
+ \pgfplotstableread@skiplinetrue
+ \pgfplotstableread@impl@gobble
+}
+
+\def\pgfplotstableread@create@column@lists{%
+ \loop
+ \ifnum\pgfplotstableread@curcol<\pgfplotstableread@numcols
+ \expandafter\pgfplotslistnewempty\csname numtable@col@\the\pgfplotstableread@curcol\endcsname
+ \advance\pgfplotstableread@curcol by1\relax
+ \repeat
+}
+
+\def\pgfplotstableread@create@column@names@with@numbers{%
+ \pgfplotstableread@curcol=0\relax
+ \loop
+ \ifnum\pgfplotstableread@curcol<\pgfplotstableread@numcols
+ \expandafter\pgfplotslistpushback\the\pgfplotstableread@curcol\to\pgfplotstable@colnames
+ \advance\pgfplotstableread@curcol by1\relax
+ \repeat
+}
+
+\long\def\pgfplotstableread@impl@gobble#1\pgfplotstable@EOI{}%
+
+\def\pgfplotstable@EOI{\pgfplotstable@EOI}%
+
+%%%%%%%%%%%%%%%
+
+% A loop command which processes every single entry in a raw data row #2
+% and invokes the macro #1{<arg>} for each found column entry.
+%
+% Columns are separated by the /pgfplots/table/col sep character.
+%
+% #1: a command which takes precisely one argument. It will be called
+% for each found column entry
+%
+% #2: a macro containing a raw data line with <col sep> separated
+% entries.
+\def\pgfplotstableread@impl@DO#1#2{%
+ \let\pgfplotstableread@impl@ITERATE@NEXT@=#1\relax
+ \ifcase\pgfplotstableread@COLSEP@CASE\relax
+ % SPACE:
+ \expandafter\pgfplotstableread@impl@ITERATE#2\pgfplotstable@EOI
+ \or
+ % COMMA:
+ \let\pgfplotstableread@impl@ITERATE@NEXT=\pgfplotstableread@impl@ITERATE@NEXT@COMMA
+ \expandafter\pgfplotstableread@impl@ITERATE#2,\pgfplotstable@EOI
+ \or
+ % SEMICOLON:
+ \let\pgfplotstableread@impl@ITERATE@NEXT=\pgfplotstableread@impl@ITERATE@NEXT@SEMICOLON
+ \expandafter\pgfplotstableread@impl@ITERATE#2;\pgfplotstable@EOI
+ \or
+ % COLON:
+ \let\pgfplotstableread@impl@ITERATE@NEXT=\pgfplotstableread@impl@ITERATE@NEXT@COLON
+ \expandafter\pgfplotstableread@impl@ITERATE#2:\pgfplotstable@EOI
+ \or
+ % BRACE:
+ \let\pgfplotstableread@impl@ITERATE@NEXT=\pgfplotstableread@impl@ITERATE@NEXT@BRACE
+ \expandafter\pgfplotstableread@impl@ITERATE#2\pgfplotstable@EOI
+ \fi
+}%
+\def\pgfplotstableread@impl@ITERATE{%
+ \pgfutil@ifnextchar\pgfplotstable@EOI{%
+ \pgfplotstableread@impl@gobble
+ }{%
+ \pgfplotstableread@impl@ITERATE@NEXT
+ }%
+}%
+\def\pgfplotstableread@impl@ITERATE@NEXT#1 {%
+ \pgfplotstableread@impl@ITERATE@NEXT@{#1}%
+ \pgfplotstableread@impl@ITERATE
+}%
+\def\pgfplotstableread@impl@ITERATE@NEXT@COMMA#1,{%
+ \pgfplotstableread@impl@ITERATE@NEXT@{#1}%
+ \pgfplotstableread@impl@ITERATE
+}%
+\def\pgfplotstableread@impl@ITERATE@NEXT@SEMICOLON#1;{%
+ \pgfplotstableread@impl@ITERATE@NEXT@{#1}%
+ \pgfplotstableread@impl@ITERATE
+}%
+\def\pgfplotstableread@impl@ITERATE@NEXT@COLON#1:{%
+ \pgfplotstableread@impl@ITERATE@NEXT@{#1}%
+ \pgfplotstableread@impl@ITERATE
+}%
+\def\pgfplotstableread@impl@ITERATE@NEXT@BRACE#1{%
+ \pgfplotstableread@impl@ITERATE@NEXT@{#1}%
+ \pgfplotstableread@impl@ITERATE
+}%
+%%%%%%%%%%%%
+
+
+\long\def\pgfplotstableread@impl@nextrow@NEXT#1{%
+%\pgfplots@message{Inserting '#1' at (\the\pgfplotstableread@lineno, \the\pgfplotstableread@curcol).}%
+ \def\pgfplotstableread@TMP{\pgfplotslistpushback#1\to}%
+ \expandafter\pgfplotstableread@TMP\csname numtable@col@\the\pgfplotstableread@curcol\endcsname
+ \advance\pgfplotstableread@curcol by1\relax
+}
+
+
+
+\long\def\pgfplotstableread@impl@collectcolnames@NEXT#1{%
+%\pgfplots@message{Got column name no \the\pgfplotstableread@curcol\ as '#1'}%
+ \pgfutil@ifundefined{pgfplotstableread@impl@COLNAME@#1}{%
+ \def\pgfplotstable@TMP{#1}%
+ }{% generate unique column names
+ \pgfplots@warning{Warning: table '\pgfplotstableread@filename' has non-unique column name '#1'. Only the first occurence can be accessed via column names.}%
+ \edef\pgfplotstable@TMP{#1--index\the\pgfplotstableread@curcol}%
+ }%
+ \expandafter\def\csname pgfplotstableread@impl@COLNAME@#1\endcsname{foo}% remember this name.
+ \expandafter\pgfplotslistpushback\expandafter{\pgfplotstable@TMP}\to\pgfplotstable@colnames
+ \advance\pgfplotstableread@curcol by1\relax
+}
+
+
+
+
+\long\def\pgfplotstableread@impl@countcols@and@identifynames@NEXT#1{%
+ \advance\pgfplotstableread@curcol by1\relax
+ \ifpgfplotstable@search@header
+ \ifpgfplotstableread@curline@contains@colnames
+ \else
+ \pgfplotstableread@isnumber@ITERATE#1\pgfplotstable@EOI
+%\ifpgfplotstableread@curline@contains@colnames\pgfplots@message{'#1' is a column name!}\else\pgfplots@message{'#1' is NO column name!}\fi
+ \fi
+ \fi
+}
+\def\pgfplotstableread@isnumber@plus{+}
+\def\pgfplotstableread@isnumber@minus{-}
+\def\pgfplotstableread@isnumber@zero{0}
+\def\pgfplotstableread@isnumber@one{1}
+\def\pgfplotstableread@isnumber@two{2}
+\def\pgfplotstableread@isnumber@three{3}
+\def\pgfplotstableread@isnumber@four{4}
+\def\pgfplotstableread@isnumber@five{5}
+\def\pgfplotstableread@isnumber@six{6}
+\def\pgfplotstableread@isnumber@seven{7}
+\def\pgfplotstableread@isnumber@eight{8}
+\def\pgfplotstableread@isnumber@nine{9}
+\def\pgfplotstableread@isnumber@e{e}
+\def\pgfplotstableread@isnumber@E{E}
+\def\pgfplotstableread@isnumber@period{.}
+
+\def\pgfplotstableread@isnumber@ITERATE#1{%
+ \def\pgfplotstableread@CURTOK{#1}%
+ \ifx\pgfplotstableread@CURTOK\pgfplotstable@EOI
+ \def\pgfplotstableread@NEXT{}%
+ \else
+ \def\pgfplotstableread@NEXT{\pgfplotstableread@isnumber@ITERATE}%
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@plus
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@minus
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@zero
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@one
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@two
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@three
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@four
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@five
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@six
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@seven
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@eight
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@nine
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@e
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@E
+ \else
+ \ifx\pgfplotstableread@CURTOK\pgfplotstableread@isnumber@period
+ \else
+%\message{NO ITS NOT! Token: '\meaning\pgfplotstableread@CURTOK'}%
+ % it's no number, so it is a column name.
+ \pgfplotstableread@curline@contains@colnamestrue
+ \def\pgfplotstableread@NEXT{\pgfplotstableread@impl@gobble}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi
+ \pgfplotstableread@NEXT
+}
+
+\def\pgfplotstable@error#1{\PackageError{numtable}{#1}{Please refer to the manual for further information.}}%
+
+
+\def\pgfplotstableset{%
+ \pgfqkeys{/pgfplots/table}%
+}%
+
+% Accepts a macro #1 which contains an argument denoting a column
+% name.
+%
+% It checks whether #1 starts with '#', indicating that it is actually
+% a column INDEX. If that is the case,
+% \ifpgfplotstableread@foundcolnames is set to false and the index is
+% returned into #1.
+%
+% Otherwise, \ifpgfplotstableread@foundcolnames is set to true.
+\def\pgfplotstabletypeset@is@colname#1{%
+ \expandafter\pgfplotstabletypeset@is@colname@#1\pgfplotstable@EOI
+ \ifpgfplotstableread@foundcolnames
+ \else
+ \let#1=\pgfplotstable@TMP
+ \fi
+}%
+\def\pgfplotstabletypeset@is@colname@{%
+ \pgfutil@ifnextchar[{%
+ \pgfplotstabletypeset@is@colname@index
+ }{%
+ \pgfplotstableread@foundcolnamestrue
+ \pgfplotstabletypeset@is@colname@name
+ }%
+}
+\def\pgfplotstabletypeset@is@colname@index@@{index}%
+\def\pgfplotstabletypeset@is@colname@index[#1]#2\pgfplotstable@EOI{%
+ \def\pgfplotstable@TMP{#1}%
+ \ifx\pgfplotstable@TMP\pgfplotstabletypeset@is@colname@index@@
+ \pgfplotstableread@foundcolnamesfalse
+ \def\pgfplotstable@TMP{#2}%
+ \else
+ \pgfplotstableread@foundcolnamestrue
+ \fi
+}%
+\def\pgfplotstabletypeset@is@colname@name#1\pgfplotstable@EOI{}%
+\def\pgfplotstabletypeset@getfinalentry#1#2{%
+ \pgfkeysvalueof{/pgfplots/table/assign cell content/.@cmd}#1\pgfeov
+ \pgfkeysgetvalue{/pgfplots/table/@cell content}{#2}%
+}%
+
+% processes the option 'assign column name'
+\def\pgfplotstabletypeset@assign@final@colname#1#2{%
+ \pgfkeysifdefined{/pgfplots/table/assign column name/.@cmd}{%
+ \pgfkeysvalueof{/pgfplots/table/assign column name/.@cmd}#1\pgfeov
+ \pgfkeysgetvalue{/pgfplots/table/column name}{#2}%
+ }{}%
+}
+\def\pgfplotstabletypeset@nocolname{\pgfkeysnovalue}
+
+% checks if #1 contains invalid chars for pgfkeys and sets
+% \ifpgfutil@in@ to true if that is the case.
+\def\pgfplotstable@checkspecialchars@pgfkeys#1\pgfplotstable@EOI{%
+ \pgfutil@in@/{#1}%
+ \ifpgfutil@in@
+ \else
+ \pgfutil@in@={#1}%
+ \ifpgfutil@in@
+ \else
+ \pgfutil@in@,{#1}%
+ \fi
+ \fi
+
+}%
+
+% TODO
+% - replace grouped list foreach by popfront-loop and use arrays
+% directly -> group only the pgfkeys eval
+\def\pgfplotstabletypeset@opt[#1]#2{%
+ \begingroup
+ \def\pgfplotstablecol{\the\c@pgfplotstable@colindex}%
+ \def\pgfplotstablerow{\the\c@pgfplotstable@rowindex}%
+% \def\pgfplotstablecols{\the\c@pgfplotstable@numcols}%
+% \def\pgfplotstablerows{\the\c@pgfplotstable@numrows}%
+ \ifpgfplots@table@options@areset
+ \else
+ \pgfplotstableset{/pgfplots/table/every table,#1}%
+ \fi
+ \pgfkeysgetvalue{/pgfplots/table/columns}{\pgfplotstable@colnames}%
+ \ifx\pgfplotstable@colnames\pgfutil@empty
+ \pgfplotstablegetcolumnlist#2\to\pgfplotstable@colnames
+ \else
+ \expandafter\pgfplotslistnew\expandafter\pgfplotstable@colnames\expandafter{\pgfplotstable@colnames}%
+ \fi
+ \global\pgfplotslistnewempty\pgfplotstabletypeset@final@colnames
+ \global\pgfplotslistnewempty\pgfplotstabletypeset@final@coltypes
+ \global\pgfplotslistnewempty\pgfplotstabletypeset@final@cols
+ \let\c@pgfplotstable@numcols=\c@pgf@counta
+ \let\c@pgfplotstable@numrows=\c@pgf@countd
+ \let\c@pgfplotstable@rowindex=\c@pgf@countc
+ \let\c@pgfplotstable@colindex=\c@pgf@countb
+ \pgfplotslistsize\pgfplotstable@colnames\to\c@pgfplotstable@numcols
+ \c@pgfplotstable@colindex=0\relax
+ \pgfplotslistforeach\pgfplotstable@colnames\as\pgfplotstable@colname{%
+ \c@pgfplotstable@rowindex=0\relax
+ \pgfplotstabletypeset@is@colname\pgfplotstable@colname
+ \ifpgfplotstableread@foundcolnames
+ \else
+ \pgfplotstablegetcolumnnamebyindex\pgfplotstable@colname\of#2\to\pgfplotstable@colname
+ \fi
+ \pgfplotstablegetcolumnbyname\pgfplotstable@colname\of#2\to\pgfplotstable@col
+ %
+ % Set keys for columns!
+ \ifodd\c@pgfplotstable@colindex
+ \pgfplotslist@TOK@a={every odd column}%
+ \else
+ \pgfplotslist@TOK@a={every even column}%
+ \fi
+ \ifnum\c@pgfplotstable@colindex=0\relax
+ \pgfplotslist@TOK@a=\expandafter{\the\pgfplotslist@TOK@a,every first column}%
+ \fi
+ \global\advance\c@pgfplotstable@colindex by1\relax
+ \ifnum\c@pgfplotstable@colindex=\c@pgfplotstable@numcols
+ \pgfplotslist@TOK@a=\expandafter{\the\pgfplotslist@TOK@a,every last column}%
+ \fi
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@colname}%
+ \expandafter\pgfplotstable@checkspecialchars@pgfkeys\the\pgfplotslist@TOK@b\pgfplotstable@EOI
+ \ifpgfutil@in@
+ \edef\pgfplotstable@TMP{\the\pgfplotslist@TOK@a,columns/{\the\pgfplotslist@TOK@b}/.try}%
+ \else
+ \edef\pgfplotstable@TMP{\the\pgfplotslist@TOK@a,columns/\the\pgfplotslist@TOK@b/.try}%
+ \fi
+ \expandafter\pgfplotstableset\expandafter{\pgfplotstable@TMP}%
+ %
+ \pgfkeysgetvalue{/pgfplots/table/column name}{\pgfplotstable@colname@out}%
+ \ifx\pgfplotstable@colname@out\pgfplotstabletypeset@nocolname
+ \let\pgfplotstable@colname@out=\pgfplotstable@colname
+ \fi
+ \expandafter\pgfplotstabletypeset@assign@final@colname\expandafter{\pgfplotstable@colname@out}\pgfplotstable@colname@out
+ {\globaldefs=1
+ \expandafter\pgfplotslistpushback\pgfplotstable@colname@out\to\pgfplotstabletypeset@final@colnames
+ }%
+ \pgfkeysgetvalue{/pgfplots/table/column type}{\pgfplotstable@coltype}%
+ {\globaldefs=1
+ \expandafter\pgfplotslistpushback\pgfplotstable@coltype\to\pgfplotstabletypeset@final@coltypes
+ }%
+ %
+ \pgfplotslistnewempty\pgfplotstable@col@processed
+ \pgfplotslistforeachungrouped\pgfplotstable@col\as\pgfplotstable@entry{%
+ \pgfplotstableuserowtrue
+ \edef\pgfplotstable@TMP{\noexpand\pgfkeysvalueof{/pgfplots/table/row predicate/.@cmd}\the\c@pgfplotstable@rowindex}%
+ \pgfplotstable@TMP\pgfeov
+ \ifpgfplotstableuserow
+ \expandafter\pgfplotstabletypeset@getfinalentry\expandafter{\pgfplotstable@entry}{\pgfplotstable@entry}%
+ \expandafter\pgfplotslistpushback\pgfplotstable@entry\to\pgfplotstable@col@processed
+ \fi
+ \advance\c@pgfplotstable@rowindex by1\relax
+ }%
+ {\globaldefs=1
+ \expandafter\pgfplotslistpushback\expandafter{\pgfplotstable@col@processed}\to\pgfplotstabletypeset@final@cols
+ }%
+ }%
+ %
+ % Ok, I have now everything which will come into the final table.
+ %
+ % But I have it column-oriented; I need to transpose the storage.
+ %
+ % The following code assembles a
+ % \begin{tabular}{}
+ % ...
+ % \end{tabular}
+ % statement piece after piece.
+ %
+%\message{I have now \meaning\pgfplotstabletypeset@final@colnames, and \meaning\pgfplotstabletypeset@final@cols.}%
+ % Step 1: column names.
+ \c@pgfplotstable@colindex=0\relax
+ % STEP 1.1: collect column types:
+ \def\pgfplotstable@resulttypes{}%
+ \pgfplotslistforeachungrouped\pgfplotstabletypeset@final@coltypes\as\pgfplotstable@coltype{%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@resulttypes}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@coltype}%
+ \edef\pgfplotstable@resulttypes{\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+ }%
+ \pgfkeysgetvalue{/pgfplots/table/begin table}{\pgfplotstable@entry}%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@entry}%
+ \ifx\pgfplotstable@resulttypes\pgfutil@empty
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@a}%
+ \else
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@resulttypes}%
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@a{\the\pgfplotslist@TOK@b}}%
+ \fi
+ %
+ \pgfkeysgetvalue{/pgfplots/table/font}{\pgfplotstable@font}%
+ \ifx\pgfplotstable@font\pgfutil@empty
+ \else
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@font}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@result}%
+ \edef\pgfplotstable@result{\noexpand\begingroup\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+ \fi
+ %
+
+ % Step 1.2: Collect FIRST ROW (column names)
+ \begingroup
+ \pgfplotstableset{every head row}%
+ \pgfkeysgetvalue{/pgfplots/table/before row}{\pgfplotstable@before}%
+ \pgfkeysgetvalue{/pgfplots/table/after row}{\pgfplotstable@after}%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@before}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@after}%
+ \xdef\pgfplotstable@TMP{%
+ \noexpand\def\noexpand\pgfplotstable@before{\the\pgfplotslist@TOK@a}%
+ \noexpand\def\noexpand\pgfplotstable@after{\the\pgfplotslist@TOK@b}%
+ }%
+ \endgroup
+ \pgfplotstable@TMP
+ % insert 'before row' here:
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@before}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@result}%
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@b\the\pgfplotslist@TOK@a}%
+ %
+ \pgfplotslistforeachungrouped\pgfplotstabletypeset@final@colnames\as\pgfplotstable@colname@out{%
+ \advance\c@pgfplotstable@colindex by1\relax
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@result}%
+ \ifnum\c@pgfplotstable@colindex=\c@pgfplotstable@numcols\relax
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@colname@out \\}%
+ \else
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@colname@out &}%
+ \fi
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+ }%
+ % insert 'after row' here:
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@result}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@after}%
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+ %
+%\message{I have now \meaning\pgfplotstable@result.}%
+ % Step 2: column contents.
+ % I will first convert \pgfplotstabletypeset@final@cols into an array.
+ \c@pgfplotstable@colindex=0\relax
+ \pgfplotsarraynewempty\pgfplotstabletypeset@final@cols@array
+ \pgfplotslistforeachungrouped\pgfplotstabletypeset@final@cols\as\pgfplotstable@col@processed{%
+ \expandafter\pgfplotsarraypushback\expandafter{\pgfplotstable@col@processed}\to\pgfplotstabletypeset@final@cols@array
+ }%
+ % init numrows:
+ \pgfplotsarrayselect\c@pgfplotstable@colindex\of\pgfplotstabletypeset@final@cols@array\to\pgfplotstable@col@processed
+ \pgfplotslistsize\pgfplotstable@col@processed\to\c@pgfplotstable@numrows
+ %
+ % Now, we loop over every column as long as there are still rows
+ % left. We assemble rows while we go.
+ %
+ \c@pgfplotstable@rowindex=0\relax
+ \ifnum\c@pgfplotstable@colindex<\c@pgfplotstable@numcols
+ \pgfplots@loop@CONTINUEtrue
+ \else
+ \pgfplots@loop@CONTINUEfalse
+ \fi
+ \loop
+ \ifpgfplots@loop@CONTINUE
+ \pgfplotsarrayselect\c@pgfplotstable@colindex\of\pgfplotstabletypeset@final@cols@array\to\pgfplotstable@col@processed
+ \pgfplotslistcheckempty\pgfplotstable@col@processed
+ \ifpgfplotslistempty
+ \pgfplots@loop@CONTINUEfalse
+ \else
+ \ifnum\c@pgfplotstable@colindex=0\relax
+ % Install styles for the next row.
+ \begingroup
+ \ifodd\c@pgfplotstable@rowindex
+ \pgfplotslist@TOK@a={every odd row}%
+ \else
+ \pgfplotslist@TOK@a={every even row}%
+ \fi
+ \ifnum\c@pgfplotstable@rowindex=0\relax
+ \pgfplotslist@TOK@a=\expandafter{\the\pgfplotslist@TOK@a,every first row}%
+ \fi
+ % misuse as temporary variable:
+ \c@pgfplotstable@colindex=\c@pgfplotstable@rowindex
+ \advance\c@pgfplotstable@colindex by1\relax
+ \ifnum\c@pgfplotstable@colindex=\c@pgfplotstable@numrows
+ \edef\pgfplotstable@TMP{\the\pgfplotslist@TOK@a,every row no \the\c@pgfplotstable@rowindex/.try,every last row}%
+ \else
+ \edef\pgfplotstable@TMP{\the\pgfplotslist@TOK@a,every row no \the\c@pgfplotstable@rowindex/.try}%
+ \fi
+ \expandafter\pgfplotstableset\expandafter{\pgfplotstable@TMP}%
+ \pgfkeysgetvalue{/pgfplots/table/before row}{\pgfplotstable@before}%
+ \pgfkeysgetvalue{/pgfplots/table/after row}{\pgfplotstable@after}%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@before}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@after}%
+ \xdef\pgfplotstable@TMP{%
+ \noexpand\def\noexpand\pgfplotstable@before{\the\pgfplotslist@TOK@a}%
+ \noexpand\def\noexpand\pgfplotstable@after{\the\pgfplotslist@TOK@b}%
+ }%
+ \endgroup
+ \pgfplotstable@TMP
+ % insert 'before row' here:
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@before}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@result}%
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@b\the\pgfplotslist@TOK@a}%
+ \fi
+ %
+ %
+ \pgfplotslistpopfront\pgfplotstable@col@processed\to\pgfplotstable@entry
+ \pgfplotsarrayletentry\c@pgfplotstable@colindex\of\pgfplotstabletypeset@final@cols@array=\pgfplotstable@col@processed
+ \advance\c@pgfplotstable@colindex by1\relax
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@result}%
+ \ifnum\c@pgfplotstable@colindex=\c@pgfplotstable@numcols\relax
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@entry \\}%
+ \else
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@entry &}%
+ \fi
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+ \ifnum\c@pgfplotstable@colindex=\c@pgfplotstable@numcols\relax
+ \c@pgfplotstable@colindex=0\relax
+ % insert 'after row' here:
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@result}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@after}%
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+ \advance\c@pgfplotstable@rowindex by1\relax
+ \fi
+%\message{I have now \meaning\pgfplotstable@result.}%
+ \fi
+ \repeat
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@result}%
+ \pgfkeysgetvalue{/pgfplots/table/end table}{\pgfplotstable@entry}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplotstable@entry}%
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@a\the\pgfplotslist@TOK@b}%
+ \ifx\pgfplotstable@font\pgfutil@empty
+ \else
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@result\endgroup}%
+ \edef\pgfplotstable@result{\the\pgfplotslist@TOK@a}%
+ \fi
+ \ifpgfplotstabletypesetdebug
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@result}%
+ \immediate\write16{------- PGFPLOTSTABLE DEBUG MODE: --------}%
+ \immediate\write16{{\the\pgfplotslist@TOK@a}}%
+ \fi
+ \pgfkeysgetvalue{/pgfplots/table/outfile}{\pgfplotstable@entry}%
+ \ifx\pgfplotstable@entry\pgfutil@empty
+ \else
+ \begingroup
+ \immediate\openout\pgfplotstable@outfile=\pgfplotstable@entry\relax
+ \pgfplotslist@TOK@a=\expandafter{\pgfplotstable@result}%
+ \immediate\write\pgfplotstable@outfile{\the\pgfplotslist@TOK@a}%
+ \immediate\closeout\pgfplotstable@outfile
+ \endgroup
+ \fi
+ \pgfplotstable@result
+ \endgroup
+}%
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.coltype.code.tex b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.coltype.code.tex
new file mode 100644
index 00000000000..b56d65147fc
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.coltype.code.tex
@@ -0,0 +1,85 @@
+%--------------------------------------------
+%
+% Package numtable.
+%
+% This file provides support for column types in LaTeX tabular
+% environments, i.e.
+%
+%\begin{tabular}{>{\pgfplotstablecoltype}c<{\endpgfplotstablecoltype}}
+% 1 \\
+% 2 \\
+% 3 \\
+%\end{tabular}
+%
+%
+%
+% Copyright 2007/2008 by Christian Feuersänger.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%--------------------------------------------
+
+
+
+% If I did not get it wrong, the tabular package, initialised with a
+% column type like
+% >{\pgfplotstablecoltype}c<{\endpgfplotstablecoltype}
+% yields
+%
+% \pgfplotstablecoltype \ignorespaces <content> \unskip \endpgfplotstablecoltype
+% OR
+% \pgfplotstablecoltype \ignorespaces <content> \\ \endpgfplotstablecoltype
+%
+% So, I define \pgfplotstablecoltype to skip \ignorespaces and \unskip and simply
+% get <content>.
+\def\pgfplotstablecoltype{%
+ \begingroup
+ \let\pgfplotstablecoltype@content=\empty
+ \pgfutil@ifnextchar[{%
+ \pgfplotstablecoltype@
+ }{%
+ \pgfplotstablecoltype@until@end@start
+ }%
+}%
+\def\pgfplotstablecoltype@[#1]{%
+ \pgfqkeys{/pgf/number format}{#1}%
+ \pgfplotstablecoltype@until@end@start
+}%
+
+\def\pgfplotstablecoltype@until@end@start\ignorespaces{%
+ \pgfplotstablecoltype@until@end
+}%
+\def\pgfplotstablecoltype@until@end{%
+ \pgfutil@ifnextchar\\{%
+ \pgfplotstablecoltype@finish%
+ }{%
+ \pgfutil@ifnextchar{\unskip}{%
+ \pgfplotstablecoltype@finish%
+ }{%
+ \pgfplotstablecoltype@next
+ }%
+ }%
+}
+\def\pgfplotstablecoltype@next#1{%
+ \expandafter\def\expandafter\pgfplotstablecoltype@content\expandafter{\pgfplotstablecoltype@content#1}%
+ \pgfplotstablecoltype@until@end
+}
+\def\pgfplotstablecoltype@finish{%
+%\message{COLLECTED \meaning\pgfplotstablecoltype@content}%
+ \pgfmathprintnumber{\pgfplotstablecoltype@content}%
+ \endgroup
+}%
+
+%\def\pgfplotstablecoltype{\message{COLLECT}}%
+\def\endpgfplotstablecoltype{}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
new file mode 100644
index 00000000000..628fc7f374e
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
@@ -0,0 +1,12 @@
+\pgfkeysifdefined{/pgf/number format/1000 sep/.@cmd}{\endinput}{}
+%--------------------------------------------------
+% \pgfutil@ifundefined{pgfplothandlerybarinterval}
+% {}%
+% {\endinput}%
+%--------------------------------------------------
+
+\immediate\write16{Package pgfplots: loading support code for older PGF versions...}
+\input pgfplotsoldpgfsupp_misc.code.tex
+\input pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex
+\input pgfplotsoldpgfsupp_pgfmathfloat.code.tex
+\input pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex
new file mode 100644
index 00000000000..9e037470f6e
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex
@@ -0,0 +1,96 @@
+
+% ======================================================
+% compatibility with PGF 2.0
+\def\pgfkeysaddvalue#1#2#3{%
+ {%
+ \toks0{#2}%
+ \pgfkeysifdefined{#1}
+ {\pgfkeys@temptoks\expandafter\expandafter\expandafter{\csname pgfk@#1\endcsname}}%
+ {\pgfkeys@temptoks{}}%
+ \toks1{#3}%
+ \xdef\pgfkeys@global@temp{\the\toks0 \the\pgfkeys@temptoks \the\toks1}% believe or don't: the spaces are important
+ }%
+ \pgfkeyslet{#1}\pgfkeys@global@temp%
+}
+
+\def\pgfkeys@try{%
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}%
+ {%
+ \pgfkeysgetvalue{\pgfkeyscurrentpath/.@cmd}{\pgfkeys@code}%
+ \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@def}%
+ {\pgfkeysgetvalue{\pgfkeyscurrentpath/.@def}{\pgfkeyscurrentvalue}}
+ {}% no default, so leave it
+ \fi%
+ \let\pgfkeyscurrentkey=\pgfkeyscurrentpath% make sure that \pgfkeys@code doesn't know about 'try'. Important for .is choice
+ % FIXME: maybe there are more things like that - also adjust currentname!?
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov%
+ \pgfkeyssuccesstrue%
+ }%
+ {%
+ \pgfkeysifdefined{\pgfkeyscurrentpath}%
+ {%
+ \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text%
+ \pgfkeysvalueof{\pgfkeyscurrentpath}%
+ \else%
+ \pgfkeyslet{\pgfkeyscurrentpath}\pgfkeyscurrentvalue%
+ \fi%
+ \pgfkeyssuccesstrue%
+ }%
+ {\pgfkeyssuccessfalse}%
+ }%
+}
+% ======================================================
+
+\def\pgfutilensuremath#1{%
+ \ifmmode#1\else$#1$\fi
+}
+
+\tikzoption{ybar}[]{\let\tikz@plot@handler=\pgfplothandlerybar}
+\tikzoption{xbar}[]{\let\tikz@plot@handler=\pgfplothandlerxbar}
+\tikzoption{ybar interval}[]{\let\tikz@plot@handler=\pgfplothandlerybarinterval}
+\tikzoption{xbar interval}[]{\let\tikz@plot@handler=\pgfplothandlerxbarinterval}
+\tikzoption{const plot}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlineto}
+\tikzoption{const plot mark left}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlineto}
+\tikzoption{const plot mark right}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlinetomarkright}
+\tikzoption{jump mark right}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkright}
+\tikzoption{jump mark left}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkleft}
+
+
+
+
+% ======================================================
+
+
+\newif\ifpgfmathcomparison
+
+% Assigns \pgfmathresult to 1.0 if #1 ~= #1.
+%
+% It will also set the boolean \ifpgfmathcomparison accordingly
+% (globally).
+\def\pgfmathapproxequalto#1#2{%
+ \edef\pgfmath@marshal{%
+ \noexpand\pgfmathparse{#2}
+ \noexpand\let\noexpand\pgfmath@arg\noexpand\pgfmathresult%
+ \noexpand\pgfmathparse{#1}%
+ }%
+ \pgfmath@marshal%
+ \pgfmathapproxequalto@{\pgfmathresult}{\pgfmath@arg}}
+\def\pgfmathapproxequalto@#1#2{%
+ \begingroup%
+ \pgfmath@x#1pt%
+ \pgfmath@y#2pt%
+ \advance\pgfmath@x-\pgfmath@y%
+ \ifdim\pgfmath@x<0pt
+ \multiply\pgfmath@x by-1
+ \fi
+ \ifdim\pgfmath@x<0.0001pt\relax%
+ \def\pgfmathresult{1.0}%
+ \global\pgfmathcomparisontrue
+ \else%
+ \def\pgfmathresult{0.0}%
+ \global\pgfmathcomparisonfalse
+ \fi%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup%
+}
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex
new file mode 100644
index 00000000000..cd5c328c700
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex
@@ -0,0 +1,927 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+%
+% This file contains additions to pgfkeys.code.tex (loaded
+% automatically at the end of pgfkeys.code.tex)
+%
+% Improvements:
+%
+% - option filtering
+% you provide
+% - a boolean predicate
+% - a "filter handler" which will be invoked for non-matching options,
+% - a key=value list as usual.
+% The filter sets only matching options and invokes the handler for
+% unmatching ones.
+%
+% - Fast family support as in xkeyval.
+% - A key like /my tree/my option can be associated with /my family
+% - You can efficiently set keys which belong to a set of "active"
+% families.
+% Remaining options can be collected into a macro.
+
+% WARNING:
+% this file overwrites
+% \pgfkeys@addpath
+% \pgfkeys@nevermind
+%
+% all other features are 'additive'
+
+
+% these implementations will be switched dynamically with their
+% filtered versions (in \pgfkeys@install@filter@and@invoke)
+\let\pgfkeys@orig@case@one=\pgfkeys@case@one
+\let\pgfkeys@orig@@set=\pgfkeys@@set
+\let\pgfkeys@orig@@qset=\pgfkeys@@qset
+\let\pgfkeys@orig@try=\pgfkeys@try
+\let\pgfkeys@orig@unknown=\pgfkeys@unknown
+
+\newif\ifpgfkeysfilteringisactive
+\newif\ifpgfkeysfiltercontinue
+\let\pgfkeys@key@predicate=\pgfkeys@empty
+\let\pgfkeys@filtered@handler=\pgfkeys@empty
+\newtoks\pgfkeys@tmptoks
+
+% Performs 'filtered' key settings.
+%
+% For every option for which the path prefixing has already been done,
+% the current key filter predicate will be invoked. If the predicate
+% returns true, pgfkeys will process this key in the normal manner.
+% If not, a key filter handler will be invoked.
+%
+% The *predicate* and *handler* semantics are as follows:
+% PRECONDITION:
+% 1. The variables
+% \pgfkeyscurrentkey (full path including name)
+% \pgfkeyscurrentkeyRAW (the current key as it has been
+% found in the key=value list
+% without path modification)
+% \pgfkeyscurrentvalue
+% are all set. If the current key is a handler variable,
+% \pgfkeyscurrentname
+% and
+% \pgfkeyscurrentpath
+% are also set.
+% 2. The type of option has already been checked, that means
+% case (1) whether '.@cmd' exists
+% case (2) whether the key as such has its value
+% case (3) it is a handler like '.code', '.cd' or whatever.
+% case (0) it is unknown.
+% The actual case number (0-3) will be provided as contents
+% of the macro
+% \pgfkeyscasenumber.
+% Please note that unknown options will be processed with
+% the usual '.unknown' handlers unless the key filter takes
+% control over unknown options as well.
+%
+% POSTCONDITION:
+% the predicate sets
+% \pgfkeysfiltercontinuetrue
+% or
+% \pgfkeysfiltercontinuefalse
+% (the boolean \ifpgfkeysfiltercontinue).
+% Depending on this 'if', option processing will be continued or
+% skipped.
+%
+% The handler can do anything with the option, for example collect
+% unmatched ones.
+%
+% ATTENTION: \pgfkeysfiltered can't be nested (yet). Use the
+% \pgfkeyspredicateAND if you need multiple predicates at once.
+% Nesting would produce unexpected results because the current filter
+% state can't be stored/restored without TeX-groups, therefor it is
+% disabled.
+%
+% ATTENTION: you can't filter error messages.
+%
+% REMARK: In case (3), the macros \pgfkeyscurrentpath and
+% \pgfkeyscurrentname have already been computed, you do not need to
+% invoke \pgfkeyssplitpath. In any other case, neither path nor name
+% are required for the options processing - if you need them for
+% predicates/handlers, you need to compute them by hand.
+%
+%
+% Example:
+% \def\unmatched{}
+% \pgfkeys{/pgf/key filters/is descendant of/.install key filter=/my group}
+% \pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\unmatched}
+% \pgfkeysfiltered%
+% {/my group/option 1=value 1,/tikz/option 2=value 2}
+% ->
+% will set '/my group/option 1' as usual, but '/tikz/option 2' will not
+% be set. Instead, it will be appended to '\unmatched' such that
+% \unmatched = {/tikz/option 2=value2}
+% after the operation.
+%
+% Arguments:
+% #1: key-value list.
+\def\pgfkeysfiltered{%
+ % produce
+ % '{<default path>}'
+ % each expanded exactly one time into the register:
+ \expandafter\pgfkeysfiltered@@install\expandafter{\pgfkeysdefaultpath}%
+}
+
+% #1: old value of default path.
+% #2: key-value-list.
+\def\pgfkeysfiltered@@install#1#2{%
+ \pgfkeys@install@filter@and@invoke{%
+ \let\pgfkeysdefaultpath\pgfkeys@root%
+ \pgfkeys@parse#2,\pgfkeys@mainstop%
+ \def\pgfkeysdefaultpath{#1}%
+ }%
+}
+
+% Assuming that macro #1 contains a key=value list, this command
+% performs an \pgfkeysalso command for the content of macro #1.
+%
+% It can be used in conjunction with
+% - \pgfkeysfiltered and
+% - \pgfkeysappendfilterednamestomacro:
+% the first pass fill only process options matching the filter, then,
+% a \pgfkeysalsofrom can be used at a later time to set the remaining
+% options.
+%
+% Example:
+% \pgfkeys{/my group/.cd,/utils/exec=\pgfkeysalsofrom\filtered}
+\def\pgfkeysalsofrom#1{%
+ \expandafter\pgfkeysalso\expandafter{#1}%
+}
+
+% The same as \pgfkeysalsofrom, but it invokes \pgfkeysalsofiltered.
+\def\pgfkeysalsofilteredfrom#1{%
+ \expandafter\pgfkeysalsofiltered\expandafter{#1}%
+}
+
+% #1 = options
+\long\def\pgfkeysalsofiltered#1{%
+ \pgfkeys@install@filter@and@invoke{\pgfkeysalso{#1}}%
+}%
+
+% The same like \pgfkeysfiltered, but with quick search path setting.
+%
+% #1: default path
+% #2: key-value-pairs
+\def\pgfqkeysfiltered#1{%
+ \expandafter\pgfqkeysfiltered@@install\expandafter{\pgfkeysdefaultpath}{#1}%
+}
+
+% #1: old value of default path.
+% #2: default path
+% #3: key-value-list.
+\def\pgfqkeysfiltered@@install#1#2#3{%
+ \pgfkeys@install@filter@and@invoke{%
+ \def\pgfkeysdefaultpath{#2/}\pgfkeys@parse#3,\pgfkeys@mainstop\def\pgfkeysdefaultpath{#1}%
+ }%
+}
+
+% Family management
+%
+% The family code provides the following features:
+% 1. every key can be associated with 0 or 1 'family'.
+% 2. Families are a loose association which are independend of the key
+% hierarchy.
+% For example, /my tree/key1 can belong to family /tikz.
+%
+% 3. It is possible to "activate" or "deactivate" single families.
+% Furthermore, it is possible to set only keys which belong to
+% active families (using \pgfkeysfiltered).
+% 4. Runtime complexities:
+% If you have N options and you only want to process K active
+% families, the runtime is O( N + K ):
+% - activate every family O(K)
+% - use \pgfkeyshasactivefamily as filter predicate O(N)
+% - deactivate every family O(K)
+
+
+% Activates family #1.
+%
+% #1 maybe a macro.
+\def\pgfkeysactivatefamily#1{%
+ \pgfkeysiffamilydefined
+ {#1}%
+ {\csname pgfk@#1/familyactivetrue\endcsname}%
+ {\pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov}%
+%\message{[ACTIVATING FAMILY #1]}%
+}
+
+% Deactivates family #1.
+%
+% #1 maybe a macro.
+\def\pgfkeysdeactivatefamily#1{
+ \pgfkeysiffamilydefined
+ {#1}%
+ {\csname pgfk@#1/familyactivefalse\endcsname}%
+ {\pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov}%
+%\message{[DEACTIVATING FAMILY #1]}%
+}
+
+% Activates all families in the comma separated list #1.
+%
+% It will also generate code for deactivation of all those families
+% into the command #2.
+%
+% #1: a comma-separated list of fully qualified family names.
+% #2: a command which will be filled with a deactivate-all command.
+\def\pgfkeysactivatefamilies#1#2{%
+ \pgfkeyssavekeyfilterstateto\pgfkeys@cur@state
+ \expandafter\pgfkeysactivatefamilies@impl\expandafter{\pgfkeys@cur@state}{#1}{#2}%
+}
+% #1: commands needed to restore the old filtering state
+% #2: family name list
+% #3: macro name for de-activate command
+\def\pgfkeysactivatefamilies@impl#1#2#3{%
+ \pgfkeysinstallkeyfilter{/pgf/key filters/false}{}%
+ \let#3=\pgfkeys@empty%
+ \def\pgfkeys@filtered@handler{\pgfkeys@family@activate@handler{#3}}%
+ \pgfkeysalsofiltered{#2}%
+ #1%
+}
+
+\def\pgfkeys@family@activate@handler#1{%
+ \pgfkeysactivatefamily{\pgfkeyscurrentkey}%
+ % produce
+ % <old list> '\pgfkeysdeactivatefamily{' <current key> '}'
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter#1\expandafter\pgfkeysdeactivatefamily\expandafter{\pgfkeyscurrentkey}}%
+ \edef#1{\the\pgfkeys@tmptoks}%
+}
+
+% If for testing whether a family exists.
+%
+% #1 = fully qualified family name
+% #2 = if-case
+% #3 = else-case
+%
+% Description:
+%
+% If the family exists, #2 will be executed. Otherwise, #3 will be
+% called.
+\long\def\pgfkeysiffamilydefined#1#2#3{\pgfkeys@ifcsname ifpgfk@#1/familyactive\endcsname#2\else#3\fi}
+
+% Sets the TeX boolean
+% \ifpgfkeysfiltercontinue := ( family #1 is active )
+%
+% Argument:
+% #1 the family name. Maybe a macro.
+\def\pgfkeysisfamilyactive#1{%
+ \pgfkeysiffamilydefined{#1}{%
+ \expandafter\let\expandafter\ifpgfkeysfiltercontinue\csname ifpgfk@#1/familyactive\endcsname
+ }{%
+ \pgfkeysvalueof{/errors/family unknown/.@cmd}{#1}\pgfeov%
+ \expandafter\expandafter\expandafter\let\csname ifpgfkeysfiltercontinue\endcsname\csname iffalse\endcsname
+ }%
+}%
+
+% Retrieve the family of full key #1 into macro #2.
+%
+% Will set the TeX boolean \ifpgfkeyssuccess to whether the full key
+% really has a family.
+%
+% The family for any key is stored in the sub-key #1/family.
+%
+% Parameters:
+% #1: the full key name for which the family is requested. Maybe a
+% macro.
+% #2: a macro name which will be filled with the result.
+\def\pgfkeysgetfamily#1#2{%
+ \pgfkeysifdefined{#1/family}{\pgfkeysgetvalue{#1/family}{#2}\pgfkeyssuccesstrue}{\pgfkeyssuccessfalse}%
+}
+
+
+
+% Sets \ifpgfkeysfiltercontinue to true iff the current key belongs to
+% the /errors tree.
+\long\def\pgfkeys@cur@is@descendant@of@errors{%
+ \expandafter\pgfkeys@cur@is@descendant@of@errors@impl\pgfkeyscurrentkey/errors\pgf@@eov
+}%
+\long\def\pgfkeys@cur@is@descendant@of@errors@impl#1/errors#2\pgf@@eov{%
+ \def\pgfkeyspred@TMP{#1}%
+ \ifx\pgfkeyspred@TMP\pgfkeys@empty
+%\message{[SPECIAL CHECK] '\pgfkeyscurrentkey' is descendant of '/errors': TRUE.}%
+ \pgfkeysfiltercontinuetrue
+ \else
+%\message{[SPECIAL CHECK] '\pgfkeyscurrentkey' is descendant of '/errors': FALSE.}%
+ \pgfkeysfiltercontinuefalse
+ \fi
+}%
+
+% \pgfkeysinterruptkeyfilter
+% ...
+% \endpgfkeysinterruptkeyfilter
+% temporarily interrupts key filtering and enables it in
+% \endpgfkeysinterruptkeyfilter.
+%
+% If key filtering it not active, this has no effect at all.
+%
+% REMARK:
+% \pgfkeysinterruptkeyfilter...\endpgfkeysinterruptkeyfilter does NOT
+% introduce a \TeX-group.
+\def\pgfkeysinterruptkeyfilter{%
+ \ifpgfkeysfilteringisactive
+ \let\pgfkeys@case@one=\pgfkeys@orig@case@one
+ \let\pgfkeys@try=\pgfkeys@orig@try
+ \let\pgfkeys@unknown=\pgfkeys@orig@unknown
+ \fi
+}
+
+\def\endpgfkeysinterruptkeyfilter{%
+ \ifpgfkeysfilteringisactive
+ \let\pgfkeys@case@one=\pgfkeys@case@one@filtered
+ \let\pgfkeys@try=\pgfkeys@try@filtered
+ \let\pgfkeys@unknown=\pgfkeys@unknown@filtered
+ \fi
+}
+
+% Activates families #1, calls \pgfkeysfiltered and deactivates the
+% families afterwards.
+%
+% REMARK: you need to install a family-based key filter predicate
+% manually to benefit from the activated families!
+%
+% #1: comma separated family list
+% #2: key-value pairs
+%
+% @see \pgfkeysactivatefamiliesandfilteroptions
+\def\pgfkeysactivatefamiliesandfilteroptions#1#2{%
+ \pgfkeysactivatefamilies{#1}{\pgfkeys@family@deactivation}%
+ \pgfkeysfiltered{#2}%
+ \pgfkeys@family@deactivation
+}
+
+% The "quick" variant of \pgfkeysactivatefamiliesandfilteroptions: it
+% also assigns a default path.
+%
+% #1: comma separated family list
+% #2: default path
+% #3: key-value pairs
+\def\pgfqkeysactivatefamiliesandfilteroptions#1#2#3{%
+ \pgfkeysactivatefamilies{#1}{\pgfkeys@family@deactivation}%
+ \pgfqkeysfiltered{#2}{#3}%
+ \pgfkeys@family@deactivation
+}
+
+% Public version of split path:
+\def\pgfkeyssplitpath{\pgfkeys@split@path}%
+
+
+% The same as \pgfkeysactivatefamiliesandfilteroptions but just for
+% ONE family.
+%
+% #1: family (maybe a macro)
+% #2: key-value pairs
+\def\pgfkeysactivatesinglefamilyandfilteroptions#1#2{%
+ \pgfkeysactivatefamily{#1}%
+ \pgfkeysfiltered{#2}%
+ \pgfkeysdeactivatefamily{#1}%
+}
+
+% The "quick" variant of \pgfkeysactivatesinglefamilyandfilteroptions
+%
+% #1: family (maybe a macro)
+% #2: default path
+% #3: key-value pairs
+\def\pgfqkeysactivatesinglefamilyandfilteroptions#1#2#3{%
+ \pgfkeysactivatefamily{#1}%
+ \pgfqkeysfiltered{#2}{#3}%
+ \pgfkeysdeactivatefamily{#1}%
+}
+
+% Installs the key filter '#1' with argument '#2'.
+% This is equivalent to
+% \pgfkeys{#1/.install key filter=#2}
+%
+% The current values of the key filter handler is stored into the public
+% macros
+% \pgfkeyscurrentkeyfilter
+% and
+% \pgfkeyscurrentkeyfilterargs
+%
+% #1: a full key name; may be a macro
+% #2: optional arguments for the key. If the key expects more than one
+% argument, supply '{{first}{second}}'
+\def\pgfkeysinstallkeyfilter#1#2{%
+ \pgfkeysifdefined{#1/.@cmd}{%
+ \edef\pgfkeyscurrentkeyfilter{#1}%
+ \def\pgfkeyscurrentkeyfilterargs{#2}%
+ \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@key@predicate@}%
+ \def\pgfkeys@key@predicate{\pgfkeys@key@predicate@#2\pgfeov}%
+ }{%
+ \pgfkeysvalueof{/errors/no such key filter/.@cmd}{#1}{#2}\pgfeov%
+ }%
+}
+
+% Installs the key filter handler '#1' with argument '#2'.
+% This is equivalent to
+% \pgfkeys{#1/.install key filter handler=#2}
+%
+% The current values of the key filter handler is stored into the public
+% macros
+% \pgfkeyscurrentkeyfilterhandler
+% and
+% \pgfkeyscurrentkeyfilterhandlerargs
+%
+% #1: a full key name; may be a macro
+% #2: optional arguments for the handler. If the handler expects more than one
+% argument, supply '{{first}{second}}'
+\def\pgfkeysinstallkeyfilterhandler#1#2{%
+ \pgfkeysifdefined{#1/.@cmd}{%
+ \edef\pgfkeyscurrentkeyfilterhandler{#1}%
+ \def\pgfkeyscurrentkeyfilterhandlerargs{#2}%
+ \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@filtered@handler@}%
+ \def\pgfkeys@filtered@handler{\pgfkeys@filtered@handler@#2\pgfeov}%
+ }{%
+ \pgfkeysvalueof{/errors/no such key filter handler/.@cmd}{#1}{#2}\pgfeov%
+ }%
+}
+
+% Creates a macro which contains commands to re-activate the current
+% key filter and key filter handler. It can be used to temporarily
+% switch the key filter.
+\def\pgfkeyssavekeyfilterstateto#1{%
+ % produce the string
+ % \pgfkeysinstallkeyfilter{...}{...}
+ % \pgfkeysinstallkeyfilterhandler{...}{...}
+ % where each argument is expanded once
+ % FIXME: Do the same with less overhead!
+ \pgfkeys@tmptoks={\pgfkeysinstallkeyfilter}%
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilter}}%
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterargs}\pgfkeysinstallkeyfilterhandler}%
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterhandler}}%
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfkeys@tmptoks\expandafter{\pgfkeyscurrentkeyfilterhandlerargs}}%
+ \edef#1{%
+ \the\pgfkeys@tmptoks
+ }%
+}
+
+
+\pgfkeys{%
+ /errors/family unknown/.code=\pgfkeys@error{%
+ Sorry, I do not know family '#1' and can't work with any assoicated family handling. Perhaps you misspelled it?},
+ /errors/no such key filter/.code 2 args=\pgfkeys@error{Sorry, there is no such key filter '#1'.},
+ /errors/no such key filter handler/.code 2 args=\pgfkeys@error{Sorry, there is no such key filter handler '#1'.},
+ % HANDLERS:
+ %
+ % .is family should
+ % 1. '.cd' into the families' path,
+ % 2. define booleans to activate/deactive the family
+ % (see \pgfkeysisfamilyactive)
+ % 3. make sure that \pgfkeyshasactivefamily returns true for
+ % the family itsself.
+ /handlers/.is family/.append code={%
+ %\newif is an \outer macro in plain tex, so this here is not portable:
+ %\expandafter\newif\csname if\pgfkeyscurrentpath/familyactive\endcsname
+ \edef\pgfkeyspred@TMP{pgfk@\pgfkeyscurrentpath/familyactive}%
+ \expandafter\pgfkeys@non@outer@newif\expandafter{\pgfkeyspred@TMP}%
+ \edef\pgfkeyspred@TMP{\pgfkeyscurrentpath/.belongs to family=\pgfkeyscurrentpath}%
+ \expandafter\pgfkeysalso\expandafter{\pgfkeyspred@TMP}%
+ },%
+ /handlers/.activate family/.code=\pgfkeysactivatefamily{\pgfkeyscurrentpath},
+ /handlers/.deactivate family/.code=\pgfkeysdeactivatefamily{\pgfkeyscurrentpath},
+ /handlers/.belongs to family/.code={%
+ \pgfkeysiffamilydefined{#1}{%
+ \pgfkeyssetvalue{\pgfkeyscurrentpath/family}{#1}%
+ }{%
+ \pgfkeysalso{/errors/family unknown=#1}%
+ }%
+ },%
+ %
+ %
+ % An addition to the '.try' and '.retry' handlers:
+ %
+ % It is the same as '.retry', but if the option is still unknown, the
+ % usual handlers for unknown keys will be invoked.
+ /handlers/.lastretry/.code={%
+ \ifpgfkeyssuccess\else
+ \pgfkeys@try
+ \ifpgfkeyssuccess\else
+ % discard the '.lastretry' suffix:
+ \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}%
+ \pgfkeys@split@path%
+ \pgfkeys@unknown
+ \fi
+ \fi
+ },
+ %
+ %
+ /handlers/.install key filter/.code={%
+ \pgfkeysinstallkeyfilter{\pgfkeyscurrentpath}{#1}%
+ },%
+ /handlers/.install key filter handler/.code={%
+ \pgfkeysinstallkeyfilterhandler{\pgfkeyscurrentpath}{#1}%
+ },%
+ %
+ %
+ % KEY FILTER HANDLERS:
+ %
+ /pgf/key filter handlers/append filtered to/.code={%
+ % Produce
+ % <orig key> '={' <value> '}'
+ % where both, the key and the value are expanded just ONCE:
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter\pgfkeyscurrentkeyRAW\expandafter=\expandafter{\pgfkeyscurrentvalue}}%
+ \ifx#1\pgfkeys@empty
+ \else
+ % Produce <old list> ',' <orig key> '={' <value> '}'
+ \pgfkeys@tmptoks=\expandafter\expandafter\expandafter{\expandafter#1\expandafter,\the\pgfkeys@tmptoks}%
+ \fi
+ \edef#1{\the\pgfkeys@tmptoks}%
+ },%
+ /pgf/key filter handlers/ignore/.code={},
+ /pgf/key filter handlers/ignore/.install key filter handler,
+ /pgf/key filter handlers/log/.code={%
+ \immediate\write16{LOG: the option '\pgfkeyscurrentkey' (was originally '\pgfkeyscurrentkeyRAW') (case \pgfkeyscasenumber) has not been processed due to pgfkeysfiltered.}%
+ },
+ %
+ %
+ % KEY FILTER PREDICATES:
+ %
+ % Returns true iff the currently processed key belongs to an active family.
+ % A family is active if it has been activated before.
+ /pgf/key filters/active families/.code={%
+ \ifnum\pgfkeyscasenumber=0
+ % unknown options shall be processed with the
+ % unknown-handlers.
+ \pgfkeysfiltercontinuetrue
+ \else
+ \ifnum\pgfkeyscasenumber=3
+ \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP
+ \else
+ \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \fi
+ \ifpgfkeyssuccess
+ \pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
+ \else% Ok, it does not belong to any family.
+ \pgfkeysfiltercontinuefalse
+ \fi
+ \fi
+ },%
+ %
+ %
+ %
+ % This filter works as follows:
+ % 1. if the current key belongs to a family:
+ % return whether its family is active,
+ % 2. if the current key does NOT belong to a family:
+ % return the result of criterion '#1',
+ % 3. the current key is unknown:
+ % return the result of criterion '#2'.
+ %
+ % Arguments:
+ % #1: the predicate which will be invoked in case 2.
+ % It will be invoked with the current case number as argument.
+ % #2: the predicate which will be invoked in case 3 with
+ % the current case number as argument.
+ /pgf/key filters/active families or no family/.code 2 args={%
+ \ifnum\pgfkeyscasenumber=0
+ \pgfkeysevalkeyfilterwith{#2}%
+ \else
+ \ifnum\pgfkeyscasenumber=3
+ \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP
+ \else
+ \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \fi
+ \ifpgfkeyssuccess
+ \pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
+ \else% Ok, it does not belong to any family.
+ \pgfkeysevalkeyfilterwith{#1}%
+ \fi
+ \fi
+ },
+ /pgf/key filters/active families or no family DEBUG/.code 2 args={%
+ \ifnum\pgfkeyscasenumber=0
+ \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking unknown handler '#2']}%
+ \pgfkeysevalkeyfilterwith{#2}%
+ \else
+ \ifnum\pgfkeyscasenumber=3
+ \pgfkeysgetfamily\pgfkeyscurrentpath\pgfkeyspred@TMP
+ \else
+ \pgfkeysgetfamily\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \fi
+ \ifpgfkeyssuccess
+ \pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
+ \ifpgfkeysfiltercontinue
+ \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is ACTIVE]}%
+ \else
+ \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is NOT active.]}%
+ \fi
+ \else% Ok, it does not belong to any family.
+ \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking has-no-family-handler '#1']}%
+ \pgfkeysevalkeyfilterwith{#1}%
+ \fi
+ \fi
+ },
+ %
+ % Processes only options which are childs of #1.
+ % Example:
+ % is descendant of/.install key filter=/foo
+ % will be true for
+ % /foo/bar/x=y
+ % /foo/.cd
+ % /foo/bar/.style=...
+ % but not for
+ % /bar/foo/...
+ /pgf/key filters/is descendant of/.code={%
+ \ifnum\pgfkeyscasenumber=0
+ % unknown options shall be processed with the
+ % unknown-handlers.
+ \pgfkeysfiltercontinuetrue
+ \else
+ % string prefix comparison:
+ \long\def\pgfkeysisdescendantof@impl##1#1##2\pgf@@eov{%
+ \def\pgfkeyspred@TMP{##1}%
+ \ifx\pgfkeyspred@TMP\pgfkeys@empty
+%\message{'\pgfkeyscurrentkey' (case \pgfkeyscasenumber) is descendant of '#1': TRUE.}%
+ \pgfkeysfiltercontinuetrue
+ \else
+%\message{'\pgfkeyscurrentkey' (case \pgfkeyscasenumber) is descendant of '#1': FALSE.}%
+ \pgfkeysfiltercontinuefalse
+ \fi
+ }%
+ \expandafter\pgfkeysisdescendantof@impl\pgfkeyscurrentkey#1\pgf@@eov
+ \fi
+ },%
+ %
+ %
+ %
+ % Returns true if the currently processed full key equals #2.
+ /pgf/key filters/equals/.code={%
+ \ifnum\pgfkeyscasenumber=0
+ % Unknown option:
+ \pgfkeysfiltercontinuetrue
+ \else
+ \def\pgfkeyspred@TMP{#1}%
+ \ifx\pgfkeyscurrentkey\pgfkeyspred@TMP
+ \pgfkeysfiltercontinuetrue
+ \else
+ \pgfkeysfiltercontinuefalse
+ \fi
+ \fi
+ },%
+ %
+ %
+ % Argument #1 can be any other (evaluated) filter predicate, its logical return
+ % value will be inverted.
+ % Example:
+ % not/.install key filter={is descendend of=/tikz}
+ % will install a key filter which evaluates 'is descendant of' with argument '/tikz' and returns the logical negation of the result.
+ /pgf/key filters/not/.code={%
+ \pgfkeysevalkeyfilterwith{#1}%
+ \ifpgfkeysfiltercontinue
+ \pgfkeysfiltercontinuefalse
+ \else
+ \pgfkeysfiltercontinuetrue
+ \fi
+ },%
+ /pgf/key filters/and/.code 2 args={%
+ \pgfkeysevalkeyfilterwith{#1}%
+ \ifpgfkeysfiltercontinue
+ \pgfkeysevalkeyfilterwith{#2}%
+ \fi
+ },%
+ /pgf/key filters/or/.code 2 args={%
+ \pgfkeysevalkeyfilterwith{#1}%
+ \ifpgfkeysfiltercontinue
+ \else
+ \pgfkeysevalkeyfilterwith{#2}%
+ \fi
+ },%
+ /pgf/key filters/true/.code={\pgfkeysfiltercontinuetrue},%
+ /pgf/key filters/true/.install key filter,
+ /pgf/key filters/false/.code={\pgfkeysfiltercontinuefalse},%
+ %
+ % Returns false if the current key is unknown, which avoids calling
+ % the unknown handlers.
+ /pgf/key filters/defined/.code={%
+ \ifnum\pgfkeyscasenumber=0
+ \pgfkeysfiltercontinuefalse
+ \else
+ \pgfkeysfiltercontinuetrue
+ \fi
+ },
+}%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Private IMPLEMENTATION
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+% This command does THE SAME work as \pgfkeys@case@one,
+% but it applies filtering whenever it identified the type of an
+% option.
+\def\pgfkeys@case@one@filtered{%
+ \pgfkeys@cur@is@descendant@of@errors
+ \ifpgfkeysfiltercontinue
+ \pgfkeys@orig@case@one
+ \else
+ \pgfkeysfiltercontinuetrue
+ \pgfkeysifdefined{\pgfkeyscurrentkey/.@cmd}{%
+ % CASE ONE: a command option
+ \def\pgfkeyscasenumber{1}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov
+ \else
+%\message{FILTEReD OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+ }{%
+ % CASE TWO: a normal value option
+ \pgfkeysifdefined{\pgfkeyscurrentkey}{%
+ \def\pgfkeyscasenumber{2}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@case@two@extern
+ \else
+%\message{FILTEReD OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+ }{%
+ \pgfkeys@split@path
+ % CASE THREE: a handler
+ \pgfkeysifdefined{/handlers/\pgfkeyscurrentname/.@cmd}{%
+ \def\pgfkeyscasenumber{3}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ \pgfkeysgetvalue{/handlers/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov
+ \else
+%\message{FILTERED OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+ }{%
+ \pgfkeys@unknown
+ }%
+ }%
+ }%
+ \fi
+}%
+
+\def\pgfkeys@unknown@filtered{%
+ % CASE ZERO: an unknown option.
+ \def\pgfkeyscasenumber{0}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+%\message{PROCESSING KEY \pgfkeyscurrentkey!}%
+ % start normal 'unknown' handlers:
+ \pgfkeys@orig@unknown
+ \else
+%\message{FILTEReD OUT KEY \pgfkeyscurrentkey!}%
+ \pgfkeys@filtered@handler%
+ \fi
+}
+
+% Does the same as \pgfkeys@try, but it also invokes the key filters.
+\def\pgfkeys@try@filtered{%
+ \ifpgfkeysfiltercontinue
+ \pgfkeys@orig@try
+ \else
+ \pgfkeysfiltercontinuetrue
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}%
+ {%
+ % CASE ONE: a command option
+ \def\pgfkeyscasenumber{1}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+ \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}%
+ \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value
+ \pgfkeysifdefined{\pgfkeyscurrentpath/.@def}%
+ {\pgfkeysgetvalue{\pgfkeyscurrentpath/.@def}{\pgfkeyscurrentvalue}}
+ {}% no default, so leave it
+ \fi%
+ \expandafter\pgfkeys@code\pgfkeyscurrentvalue\pgfeov%
+ \else
+ \pgfkeys@filtered@handler%
+ \fi
+ \pgfkeyssuccesstrue%
+ }%
+ {%
+ \pgfkeysifdefined{\pgfkeyscurrentpath}%
+ {% CASE TWO: a normal value option
+ \def\pgfkeyscasenumber{2}%
+ \pgfkeys@key@predicate%
+ \ifpgfkeysfiltercontinue
+ \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text%
+ \pgfkeysvalueof{\pgfkeyscurrentpath}%
+ \else%
+ \pgfkeyslet{\pgfkeyscurrentpath}\pgfkeyscurrentvalue%
+ \fi%
+ \else
+ \pgfkeys@filtered@handler%
+ \fi
+ \pgfkeyssuccesstrue%
+ }%
+ {\pgfkeyssuccessfalse}%
+ }%
+ \fi
+}
+
+
+% #1 the code to invoke after init and before cleanup
+\def\pgfkeys@install@filter@and@invoke#1{%
+ \ifpgfkeysfilteringisactive
+ \pgfkeys@error{Sorry, nested calls to key filtering routines are not allowed. (reason: It is not possible to properly restore the previous filtering state after returning from the nested call)}%
+ \fi
+ \pgfkeysfilteringisactivetrue
+ \let\pgfkeys@case@one=\pgfkeys@case@one@filtered
+ \let\pgfkeys@try=\pgfkeys@try@filtered
+ \let\pgfkeys@unknown=\pgfkeys@unknown@filtered
+ #1%
+ \let\pgfkeys@case@one=\pgfkeys@orig@case@one
+ \let\pgfkeys@try=\pgfkeys@orig@try
+ \let\pgfkeys@unknown=\pgfkeys@orig@unknown
+ \pgfkeysfilteringisactivefalse
+}
+
+
+%--------------------------------------------------
+% \def\pgfkeys@eval@key@filter@subroutine@case@one{%
+% \pgfkeysifdefined{\pgfkeyscurrentkey/.@cmd}{%
+% \pgfkeysgetvalue{\pgfkeyscurrentkey/.@cmd}{\pgfkeys@code}%
+% \let\pgfkeyspred@TMP=\pgfkeyscurrentvalue
+% \pgfkeys@eval@key@filter@subroutine@restorestate
+% \expandafter\pgfkeys@code\pgfkeyspred@TMP\pgfeov
+% }{%
+% \pgfkeysvalueof{/errors/no such key filter/.@cmd}\pgfkeyscurrentkey\pgfkeyscurrentvalue\pgfeov%
+% }%
+% }
+% % THIS VERSION IS TOO SLOW. See below.
+% \def\pgfkeysevalkeyfilterwith#1{%
+% \edef\pgfkeys@eval@key@filter@subroutine@restorestate{%
+% \noexpand\def\noexpand\pgfkeyscurrentkey{\pgfkeyscurrentkey}%
+% \noexpand\def\noexpand\pgfkeyscurrentkeyRAW{\pgfkeyscurrentkeyRAW}%
+% \noexpand\def\noexpand\pgfkeyscurrentname{\pgfkeyscurrentname}%
+% \noexpand\def\noexpand\pgfkeyscurrentvalue{\pgfkeyscurrentvalue}%
+% \noexpand\pgfkeys@pathtoks={\pgfkeyscurrentpath}%
+% }%
+% \pgfkeysinterruptkeyfilter
+% \let\pgfkeys@case@one=\pgfkeys@eval@key@filter@subroutine@case@one
+% \pgfkeysalso{#1}%
+% \endpgfkeysinterruptkeyfilter% this here also restored \pgfkeys@case@one.
+% \pgfkeys@eval@key@filter@subroutine@restorestate
+% }%
+%--------------------------------------------------
+
+
+% Evaluates a key filter '#1'. Example:
+% \pgfkeysevalkeyfilterwith{/pgf/key filters/equals=/tikz}
+%
+% \pgfkeysevalkeyfilterwith works only if key filtering is
+% active.
+%
+% The argument '#1' MUST be a FULL KEY.
+%
+% The implementation employs a subset of the \pgfkeysalso code.
+\def\pgfkeysevalkeyfilterwith#1{%
+ \pgfkeys@eval@key@filter@subroutine@unpack#1=\pgfkeysnovalue=\pgfkeys@stop
+}%
+\def\pgfkeys@eval@key@filter@subroutine@unpack#1=#2=#3\pgfkeys@stop{%
+ \pgfkeys@spdef\pgfkeyspred@TMP{#1}%
+ \edef\pgfkeyspred@TMP{\pgfkeyspred@TMP}%
+ \pgfkeys@spdef\pgfkeyspred@TMPB{#2}% TMPB=value
+ \ifx\pgfkeyspred@TMPB\pgfkeysnovalue@text% Hmm... no value
+ \pgfkeysifdefined{\pgfkeyspred@TMP/.@def}%
+ {\pgfkeysgetvalue{\pgfkeyspred@TMP/.@def}{\pgfkeyspred@TMPB}}
+ {}% no default, so leave it
+ \fi%
+ \ifx\pgfkeyspred@TMPB\pgfkeysvaluerequired%
+ \pgfkeysvalueof{/errors/value required/.@cmd}\pgfkeyspred@TMP\pgfkeyspred@TMPB\pgfeov%
+ \else%
+ \pgfkeysifdefined{\pgfkeyspred@TMP/.@cmd}{%
+ \pgfkeysgetvalue{\pgfkeyspred@TMP/.@cmd}{\pgfkeys@code}%
+ \expandafter\pgfkeys@code\pgfkeyspred@TMPB\pgfeov
+ }{%
+ \pgfkeysvalueof{/errors/no such key filter/.@cmd}\pgfkeyspred@TMP\pgfkeyspred@TMPB\pgfeov%
+ }%
+ \fi%
+}
+
+
+\def\pgfkeys@nevermind#1\relax{\let\pgfkeyscurrentkeyRAW=\pgfkeyscurrentkey}
+\def\pgfkeys@addpath#1\relax{\def\pgfkeyscurrentkeyRAW{#1}% old @addpath:
+ \edef\pgfkeyscurrentkey{\pgfkeysdefaultpath#1}%
+}
+
+\def\pgfkeys@non@outer@newif@#1#2{%
+ \expandafter\edef\csname #2true\endcsname{\noexpand\let\noexpand#1=\noexpand\iftrue}%
+ \expandafter\edef\csname #2false\endcsname{\noexpand\let\noexpand#1=\noexpand\iffalse}%
+ \csname #2false\endcsname
+}%
+
+% For latex and context, this here has the same effect as a \newif
+% applied to 'if#1'. For plain tex, it has also the same effect, but
+% it is not an \outer macro as the plain-tex \newif.
+\def\pgfkeys@non@outer@newif#1{%
+ \expandafter\pgfkeys@non@outer@newif@\csname if#1\endcsname{#1}%
+}
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex
new file mode 100644
index 00000000000..0d120a8b722
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex
@@ -0,0 +1,922 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgfplots/pgfplots/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex,v 1.3 2008/06/07 17:08:33 ludewich Exp $
+
+\newif\ifpgf@plot@started
+
+
+% This handler converts each plot stream command into a curveto
+% command, except for the first, which is converted to the previously
+% specified action.
+%
+% Example:
+%
+% \pgfpathmoveto{\pgfpointorigin}
+% \pgfsetlinetofirstplotpoint
+% \pgfplothandlercurveto
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlercurveto{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@curveto@handler@initial%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgf@plot@curveto@handler@finish%
+ \global\pgf@plot@startedfalse%
+ }%
+}
+
+\def\pgf@plot@curveto@handler@initial#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@plot@first@action{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@curveto@first{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \global\let\pgf@plot@curveto@first@support=\pgf@plot@curveto@first%
+ \global\let\pgf@plotstreampoint=\pgf@plot@curveto@handler@second%
+}
+
+\def\pgf@plot@curveto@handler@second#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@curveto@second{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@curveto@handler@third%
+ \global\pgf@plot@startedtrue%
+}
+
+\def\pgf@plot@curveto@handler@third#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@curveto@current{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ % compute difference vector:
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgf@plot@curveto@first}
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ % compute support directions:
+ \pgf@xa=\pgf@plottension\pgf@xa%
+ \pgf@ya=\pgf@plottension\pgf@ya%
+ % first marshal:
+ \pgf@process{\pgf@plot@curveto@second}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xb by-\pgf@xa%
+ \advance\pgf@yb by-\pgf@ya%
+ \advance\pgf@xc by\pgf@xa%
+ \advance\pgf@yc by\pgf@ya%
+ \edef\pgf@marshal{\noexpand\pgfpathcurveto{\noexpand\pgf@plot@curveto@first@support}%
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgf@plot@curveto@second}}%
+ {\pgf@marshal}%
+ % Prepare next:
+ \global\let\pgf@plot@curveto@first=\pgf@plot@curveto@second%
+ \global\let\pgf@plot@curveto@second=\pgf@plot@curveto@current%
+ \xdef\pgf@plot@curveto@first@support{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+}
+
+\def\pgf@plot@curveto@handler@finish{%
+ \ifpgf@plot@started%
+ \pgfpathcurveto{\pgf@plot@curveto@first@support}{\pgf@plot@curveto@second}{\pgf@plot@curveto@second}%
+ \fi%
+}
+
+
+% This commands sets the tension for smoothing of plots.
+%
+% #1 = tension of curves. A value of 1 will yield a circle when the
+% control points are at quarters of a circle. A smaller value
+% will result in a tighter curve. Default is 0.5.
+%
+% Example:
+%
+% \pgfsetplottension{0.2}
+
+\def\pgfsetplottension#1{%
+ \pgf@x=#1pt\relax%
+ \pgf@x=0.2775\pgf@x\relax%
+ \edef\pgf@plottension{\pgf@sys@tonumber\pgf@x}}
+\pgfsetplottension{0.5}
+
+
+% This handler converts the plot stream command into a curveto
+% command that is closed using a closepath.
+%
+% Example:
+%
+% \pgfpathmoveto{\pgfpointorigin}
+% \pgfplothandlerclosedcurve
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlerclosedcurve{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@closedcurve@handler@initial%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgf@plot@closedcurve@handler@finish%
+ }%
+}
+
+\def\pgf@plot@closedcurve@handler@initial#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \xdef\pgf@plot@closedcurve@initial{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@closedcurve@handler@second%
+ \global\pgf@plot@startedfalse%
+}
+
+\def\pgf@plot@closedcurve@handler@second#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@closedcurve@after@initial{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ {\pgfpathmoveto{}}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@closedcurve@handler@third%
+}
+
+\def\pgf@plot@closedcurve@handler@third#1{%
+ \global\pgf@plot@startedtrue%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@closedcurve@current{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ % compute difference vector:
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgf@plot@closedcurve@initial}
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ % compute support directions:
+ \pgf@xa=\pgf@plottension\pgf@xa%
+ \pgf@ya=\pgf@plottension\pgf@ya%
+ % first marshal:
+ \pgf@process{\pgf@plot@closedcurve@after@initial}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xb by-\pgf@xa%
+ \advance\pgf@yb by-\pgf@ya%
+ \advance\pgf@xc by\pgf@xa%
+ \advance\pgf@yc by\pgf@ya%
+ \global\let\pgf@plot@closedcurve@first=\pgf@plot@closedcurve@after@initial%
+ \global\let\pgf@plot@closedcurve@second=\pgf@plot@closedcurve@current%
+ \xdef\pgf@plot@closedcurve@after@initial@presupport{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}%
+ \xdef\pgf@plot@closedcurve@first@support{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@closedcurve@handler@fourth%
+}
+
+\def\pgf@plot@closedcurve@handler@fourth#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@closedcurve@current{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ % compute difference vector:
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgf@plot@closedcurve@first}
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ % compute support directions:
+ \pgf@xa=\pgf@plottension\pgf@xa%
+ \pgf@ya=\pgf@plottension\pgf@ya%
+ % first marshal:
+ \pgf@process{\pgf@plot@closedcurve@second}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xb by-\pgf@xa%
+ \advance\pgf@yb by-\pgf@ya%
+ \advance\pgf@xc by\pgf@xa%
+ \advance\pgf@yc by\pgf@ya%
+ \edef\pgf@marshal{\noexpand\pgfpathcurveto{\noexpand\pgf@plot@closedcurve@first@support}%
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgf@plot@closedcurve@second}}%
+ {\pgf@marshal}%
+ % Prepare next:
+ \global\let\pgf@plot@closedcurve@first=\pgf@plot@closedcurve@second%
+ \global\let\pgf@plot@closedcurve@second=\pgf@plot@closedcurve@current%
+ \xdef\pgf@plot@closedcurve@first@support{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+}
+
+\def\pgf@plot@closedcurve@handler@finish{%
+ \ifpgf@plot@started
+ %
+ % first, draw line from 2nd last to last:
+ %
+ \pgf@process{\pgf@plot@closedcurve@initial}%
+ % compute difference vector:
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgf@plot@closedcurve@first}%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ % compute support directions:
+ \pgf@xa=\pgf@plottension\pgf@xa%
+ \pgf@ya=\pgf@plottension\pgf@ya%
+ % first marshal:
+ \pgf@process{\pgf@plot@closedcurve@second}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xb by-\pgf@xa%
+ \advance\pgf@yb by-\pgf@ya%
+ \advance\pgf@xc by\pgf@xa%
+ \advance\pgf@yc by\pgf@ya%
+ \edef\pgf@marshal{\noexpand\pgfpathcurveto{\noexpand\pgf@plot@closedcurve@first@support}%
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgf@plot@closedcurve@second}}%
+ {\pgf@marshal}%
+ \xdef\pgf@plot@closedcurve@first@support{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+ %
+ % second, draw line from last point to start:
+ %
+ \pgf@process{\pgf@plot@closedcurve@after@initial}%
+ % compute difference vector:
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{\pgf@plot@closedcurve@second}%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ % compute support directions:
+ \pgf@xa=\pgf@plottension\pgf@xa%
+ \pgf@ya=\pgf@plottension\pgf@ya%
+ % first marshal:
+ \pgf@process{\pgf@plot@closedcurve@initial}%
+ \pgf@xb=\pgf@x%
+ \pgf@yb=\pgf@y%
+ \pgf@xc=\pgf@x%
+ \pgf@yc=\pgf@y%
+ \advance\pgf@xb by-\pgf@xa%
+ \advance\pgf@yb by-\pgf@ya%
+ \advance\pgf@xc by\pgf@xa%
+ \advance\pgf@yc by\pgf@ya%
+ \edef\pgf@marshal{\noexpand\pgfpathcurveto{\noexpand\pgf@plot@closedcurve@first@support}%
+ {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgf@plot@closedcurve@initial}}%
+ {\pgf@marshal}%
+ %
+ % third, draw line from first to second point:
+ %
+ \edef\pgf@marshal{\noexpand\pgfpathcurveto{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
+ {\noexpand\pgf@plot@closedcurve@after@initial@presupport}{\noexpand\pgf@plot@closedcurve@after@initial}}%
+ {\pgf@marshal}%
+ \pgfpathclose%
+ \fi%
+}
+
+
+
+
+
+% This handler converts each point in a stream into a line from the
+% $y$-axis to the given points coordinate, resulting in a
+% ``comb.''
+%
+% Example:
+%
+% \pgfplothandlerxcomb
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlerxcomb{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@xcomb@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotxzerolevelstreamend%
+ \pgfplotxzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@xcomb@handler#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \begingroup
+ \pgfplotxzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \pgfpathmoveto{\pgfqpoint{\pgf@yb}{\pgf@ya}}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+}
+
+
+% This handler converts each point in a stream into a line from the
+% $x$-axis straight up to the given points coordinate, resulting in a
+% ``comb.''
+%
+% Example:
+%
+% \pgfplothandlerycomb
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlerycomb{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@ycomb@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotyzerolevelstreamend%
+ \pgfplotyzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@ycomb@handler#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \begingroup
+ \pgfplotyzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+}
+
+% PGF Bar or comb plots usually draw something from zero to the current plot's coordinate.
+%
+% The 'zero' offset can be changed using an input stream.
+%
+% There are two such streams which can be configured independently.
+% The first one returns "zeros" for coordinate x, the second one
+% returns "zeros" for coordinate y.
+%
+% \pgfplotxzerolevelstreamstart
+% \pgfplotxzerolevelstreamnext % assigns \pgf@x globally
+% \pgfplotxzerolevelstreamnext
+% \pgfplotxzerolevelstreamnext
+% \pgfplotxzerolevelstreamend
+%
+% and
+% \pgfplotyzerolevelstreamstart
+% \pgfplotyzerolevelstreamnext % assigns \pgf@x globally
+% \pgfplotyzerolevelstreamend
+%
+\def\pgfplotxzerolevelstreamstart{\pgf@plotxzerolevelstreamstart}%
+\def\pgfplotxzerolevelstreamend{\pgf@plotxzerolevelstreamend}%
+\def\pgfplotxzerolevelstreamnext{\pgf@plotxzerolevelstreamnext}
+\def\pgfplotyzerolevelstreamstart{\pgf@plotyzerolevelstreamstart}%
+\def\pgfplotyzerolevelstreamend{\pgf@plotyzerolevelstreamend}%
+\def\pgfplotyzerolevelstreamnext{\pgf@plotyzerolevelstreamnext}
+
+% This zero level stream always returns '#1' (a dimension).
+\def\pgfplotxzerolevelstreamconstant#1{%
+ \edef\pgfplotxzerolevelstreamconstant@val{#1}%
+ \def\pgf@plotxzerolevelstreamstart{%
+ \global\let\pgf@plotxzerolevelstreamend=\relax
+ \gdef\pgf@plotxzerolevelstreamnext{\global\pgf@x=\pgfplotxzerolevelstreamconstant@val\relax}%
+ }%
+}%
+\pgfplotxzerolevelstreamconstant{0pt}%
+
+% This zero level stream always returns '#1'.
+\def\pgfplotyzerolevelstreamconstant#1{%
+ \edef\pgfplotyzerolevelstreamconstant@val{#1}%
+ \def\pgf@plotyzerolevelstreamstart{%
+ \global\let\pgf@plotyzerolevelstreamend=\relax
+ \gdef\pgf@plotyzerolevelstreamnext{\global\pgf@x=\pgfplotyzerolevelstreamconstant@val\relax}%
+ }%
+}%
+\pgfplotyzerolevelstreamconstant{0pt}%
+
+\def\pgfplotbarwidth{\pgfkeysvalueof{/pgf/bar width}}
+
+\pgfqkeys{/pgf}{%
+ bar width/.initial=10pt,
+ bar shift/.initial=0pt,
+ bar interval width/.initial=1,
+ bar interval shift/.initial=0.5,
+}
+
+% This handler places a rectangle at each point in the plot stream, a
+% rectangle which touches the x-axis at one end and the current point
+% at the other end:
+% --(X)--
+% | |
+% | |
+% | |
+% --(0)--
+% Example:
+%
+% \pgfplothandlerybar
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerybar{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@ybar@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotyzerolevelstreamend%
+ \pgfmathparse{\pgfplotbarwidth}%
+ \xdef\pgfplotbarwidth@{\pgfmathresult pt}%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar shift}}%
+ \xdef\pgfplotbarshift@{\pgfmathresult pt}%
+ \pgfplotyzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@ybar@handler#1{%
+ \pgf@process{#1}%
+ \pgf@ya=\pgf@y
+ \expandafter\pgf@xb\pgfplotbarwidth@\relax
+ \pgf@xc=\pgf@x
+ \advance\pgf@xc by-.5\pgf@xb
+ \advance\pgf@xc by\pgfplotbarshift@\relax
+ \begingroup
+ \pgfplotyzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \advance\pgf@ya by-\pgf@yb
+ \pgfpathrectangle
+ {\pgfqpoint{\pgf@xc}{\pgf@yb}}%
+ {\pgfqpoint{\pgf@xb}{\pgf@ya}}%
+}
+
+% This handler places a rectangle at each point in the plot stream, a
+% rectangle which touches the y-axis at one end and the current point
+% at the other end:
+% ---------
+% | |
+% (0) (X)
+% | |
+% ---------
+% Example:
+%
+% \pgfplothandlerxbar
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerxbar{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@xbar@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotxzerolevelstreamend%
+ \pgfmathparse{\pgfplotbarwidth}%
+ \xdef\pgfplotbarwidth@{\pgfmathresult pt}%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar shift}}%
+ \xdef\pgfplotbarshift@{\pgfmathresult pt}%
+ \pgfplotxzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@xbar@handler#1{%
+ \pgf@process{#1}%
+ \pgf@ya=\pgf@x
+ \expandafter\pgf@xb\pgfplotbarwidth@\relax
+ \pgf@xc=\pgf@y
+ \advance\pgf@xc by-.5\pgf@xb
+ \advance\pgf@xc by\pgfplotbarshift@\relax
+ \begingroup
+ \pgfplotxzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \advance\pgf@ya by-\pgf@yb
+ \pgfpathrectangle
+ {\pgfqpoint{\pgf@yb}{\pgf@xc}}%
+ {\pgfqpoint{\pgf@ya}{\pgf@xb}}%
+}
+
+% This handler is a variant of \pgfplothandlerybar which works with
+% intervals instead of points.
+%
+% Bars are drawn between successive input coordinates and the width is
+% determined relatively to the interval length.
+%
+% It looks like this:
+%
+% |---| |-----|
+% | | | |
+% | | | |
+% | | | |
+% (X)------(X)-----------(X)
+%
+% where (X) denotes the x-axis offsets of input coordinates.
+%
+% In more detail, if (x_i,y_i) and (x_{i+1},y_{i+1}) denote successive
+% input coordinates, the bar will be placed above the
+% interval [x_i,x_{i+1}], centered at
+%
+% x_i + \pgfkeysvalueof{/pgf/bar interval shift} * (x_{i+1} - x_i)
+%
+% with width
+%
+% \pgfkeysvalueof{/pgf/bar interval width} * (x_{i+1} - x_i).
+%
+% If you have N+1 input points, you will get N bars (one for each
+% interval). The y_i value of the last bar will be ignored.
+%
+% Example:
+%
+% \pgfplothandlerybarinterval
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerybarinterval{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@ybarinterval@handler@first%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotyzerolevelstreamend%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval width}}%
+ \xdef\pgfplotbarintervalwidth@{\pgfmathresult}%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval shift}}%
+ \xdef\pgfplotbarintervalshift@{\pgfmathresult}%
+ \pgfplotyzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@ybarinterval@handler@first#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@x}%
+ \xdef\pgf@plot@barinterval@bar{\the\pgf@y}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@ybarinterval@handler%
+}
+\def\pgf@plot@ybarinterval@handler#1{%
+ \pgf@process{#1}%
+ \pgf@ya=\pgf@plot@barinterval@bar
+ \xdef\pgf@plot@barinterval@bar{\the\pgf@y}%
+ \pgf@xc=\pgf@plot@barinterval@intervalstart\relax
+ \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@x}%
+ \pgf@xb=\pgf@x
+ \advance\pgf@xb by-\pgf@xc
+ \advance\pgf@xc by\pgfplotbarintervalshift@\pgf@xb
+ \pgf@xb=\pgfplotbarintervalwidth@\pgf@xb
+ \advance\pgf@xc by-.5\pgf@xb% center
+ \begingroup
+ \pgfplotyzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \advance\pgf@ya by-\pgf@yb
+ \pgfpathrectangle
+ {\pgfqpoint{\pgf@xc}{\pgf@yb}}%
+ {\pgfqpoint{\pgf@xb}{\pgf@ya}}%
+}
+
+% Like \pgfplothandlerybarinterval but for xbar.
+\def\pgfplothandlerxbarinterval{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@xbarinterval@handler@first%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplotxzerolevelstreamend%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval width}}%
+ \xdef\pgfplotbarintervalwidth@{\pgfmathresult}%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval shift}}%
+ \xdef\pgfplotbarintervalshift@{\pgfmathresult}%
+ \pgfplotxzerolevelstreamstart
+ }%
+}
+
+\def\pgf@plot@xbarinterval@handler@first#1{%
+ \pgf@process{#1}%
+ \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@y}%
+ \xdef\pgf@plot@barinterval@bar{\the\pgf@x}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@xbarinterval@handler%
+}
+\def\pgf@plot@xbarinterval@handler#1{%
+ \pgf@process{#1}%
+ \pgf@ya=\pgf@plot@barinterval@bar
+ \xdef\pgf@plot@barinterval@bar{\the\pgf@x}%
+ \pgf@xc=\pgf@plot@barinterval@intervalstart\relax
+ \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@y}%
+ \pgf@xb=\pgf@y
+ \advance\pgf@xb by-\pgf@xc
+ \advance\pgf@xc by\pgfplotbarintervalshift@\pgf@xb
+ \pgf@xb=\pgfplotbarintervalwidth@\pgf@xb
+ \advance\pgf@xc by-.5\pgf@xb% center
+ \begingroup
+ \pgfplotxzerolevelstreamnext
+ \endgroup
+ \pgf@yb=\pgf@x
+ \advance\pgf@ya by-\pgf@yb
+ \pgfpathrectangle
+ {\pgfqpoint{\pgf@yb}{\pgf@xc}}%
+ {\pgfqpoint{\pgf@ya}{\pgf@xb}}%
+}
+
+
+% This handler is very similar to \pgfplothandlerlineto, but it
+% produces CONSTANT connected pieces of the form
+%
+% x
+% |
+% x--- |
+% | x----
+% x-|
+%
+% Example:
+%
+% \pgfplothandlerconstantlineto
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerconstantlineto{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@const@line@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+\def\pgf@plot@const@line@handler#1{%
+ \pgf@plot@first@action{#1}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@y}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@const@line@handler@@%
+}
+\def\pgf@plot@const@line@handler@@#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \expandafter\pgf@yb\pgf@plot@const@line@handler@last
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@ya}%
+}
+
+% A variant of \pgfplothandlerconstantlineto which places its mark on
+% the right line ends.
+%
+% |---x
+% ---x |
+% |--x
+% x
+%
+% Example:
+%
+% \pgfplothandlerconstantlinetomarkright
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerconstantlinetomarkright{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@const@line@mark@right@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+\def\pgf@plot@const@line@mark@right@handler#1{%
+ \pgf@plot@first@action{#1}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@x}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@const@line@mark@right@handler@@%
+}
+\def\pgf@plot@const@line@mark@right@handler@@#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \expandafter\pgf@yb\pgf@plot@const@line@handler@last
+ \pgfpathlineto{\pgfqpoint{\pgf@yb}{\pgf@ya}}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@xa}%
+}
+
+% This handler is in fact a variant of \pgfplothandlerconstantlineto,
+% but it does not draw vertical lines. It produces a sequence of
+% line-to and move-to operations such that plot marks are placed at
+% each right end:
+%
+% ---x
+% ---x
+% ---x
+% --x
+%
+% Example:
+%
+% \pgfplothandlerjumpmarkright
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerjumpmarkright{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@jumpmarkright@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+\def\pgf@plot@jumpmarkright@handler#1{%
+ \pgf@plot@first@action{#1}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@x}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@jumpmarkright@handler@@%
+}
+\def\pgf@plot@jumpmarkright@handler@@#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \expandafter\pgf@yb\pgf@plot@const@line@handler@last
+ \pgfpathmoveto{\pgfqpoint{\pgf@yb}{\pgf@ya}}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@xa}%
+}
+
+% This handler is in fact a variant of \pgfplothandlerconstantlineto,
+% but it does not draw vertical lines. It produces a sequence of
+% line-to and move-to operations such that plot marks are placed at
+% each left end:
+%
+% x---
+% x---
+% x---
+% x--
+%
+% Example:
+%
+% \pgfplothandlerjumpmarkleft
+% \pgfplotxyfile{mytable}
+\def\pgfplothandlerjumpmarkleft{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@jumpmarkleft@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+\def\pgf@plot@jumpmarkleft@handler#1{%
+ \pgf@plot@first@action{#1}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@y}%
+ \global\let\pgf@plotstreampoint=\pgf@plot@jumpmarkleft@handler@@%
+}
+\def\pgf@plot@jumpmarkleft@handler@@#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \expandafter\pgf@yb\pgf@plot@const@line@handler@last
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
+ \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+ \xdef\pgf@plot@const@line@handler@last{\the\pgf@ya}%
+}
+
+
+
+% This handler converts each point in a stream into a line from the
+% origin to the point's coordinate, resulting in a ``star''.
+%
+% Example:
+%
+% \pgfplothandlerpolarcomb
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlerpolarcomb{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgf@plotstreampoint=\pgf@plot@polarcomb@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+
+\def\pgf@plot@polarcomb@handler#1{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgfpathmoveto{\pgfpointorigin}%
+ \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
+}
+
+
+
+
+% This handler draws a given mark at each point.
+%
+% #1 = some code to be executed at each point (with the coordinate
+% system translated to that point).
+% Typically, this code will be \pgfuseplotmark{whatever}.
+%
+% Example:
+%
+% \pgfplothandlermark{\pgfuseplotmark{*}}
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlermark#1{%
+ \pgf@plothandlermark{%
+ \ifnum\pgf@plot@mark@count<\pgf@plot@mark@repeat\relax%
+ \else%
+ \global\pgf@plot@mark@count=0\relax%
+ #1%
+ \fi%
+ }%
+}
+
+\newcount\pgf@plot@mark@count
+\def\pgf@plot@mark@phase{0}
+
+\def\pgf@plothandlermark#1{%
+ \def\pgf@plot@mark{#1}%
+ \def\pgf@plotstreamstart{%
+ \global\pgf@plot@mark@count=\pgf@plot@mark@repeat\relax%
+ \global\advance\pgf@plot@mark@count by-\pgf@plot@mark@phase\relax%
+ \global\let\pgf@plotstreampoint=\pgf@plot@mark@handler%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\relax%
+ }%
+}
+
+\def\pgf@plot@mark@handler#1{%
+ \global\advance\pgf@plot@mark@count by1\relax%
+ {\pgftransformshift{#1}\pgf@plot@mark}%
+}
+
+
+% Set the repeat count for marks. For example, if 3 is given as a
+% value, only every third point will get a mark.
+%
+% #1 = repeat count
+%
+% Example:
+%
+% \pgfsetplotmarkrepeat{2}
+
+\def\pgfsetplotmarkrepeat#1{\def\pgf@plot@mark@repeat{#1}}
+\pgfsetplotmarkrepeat{1}
+
+
+% Set the phase for marks. For example, if 3 is the repeat and 3 is
+% the phase, already the first point will be marked.
+%
+% #1 = the index of the first point that should be marked.
+%
+% Example:
+%
+% \pgfsetplotmarkphase{3}
+
+\def\pgfsetplotmarkphase#1{\def\pgf@plot@mark@phase{#1}}
+\pgfsetplotmarkphase{1}
+
+
+
+% This handler draws a given mark at those points whose number is
+% given in the (pgffor-like) list.
+%
+% #1 = some code to be executed at each point (with the coordinate
+% system translated to that point).
+% Typically, this code will be \pgfuseplotmark{whatever}.
+% #2 = list of positions like "1,2,4,...,9,10"
+%
+% Example:
+%
+% \pgfplothandlermarklisted{\pgfuseplotmark{*}}{1,2,4,...,9}
+% \pgfplotxyfile{mytable}
+
+\def\pgfplothandlermarklisted#1#2{%
+ \let\pgf@plot@mark@list=\pgfutil@empty%
+ \edef\pgf@marshal{\noexpand\foreach\noexpand\pgf@temp in{#2}}
+ \pgf@marshal{\xdef\pgf@plot@mark@list{\pgf@plot@mark@list(\pgf@temp)}}%
+ \pgf@plothandlermark{%
+ \edef\pgf@marshal{\noexpand\pgfutil@in@{(\the\pgf@plot@mark@count)}{\pgf@plot@mark@list}}%
+ \pgf@marshal%
+ \ifpgfutil@in@#1\fi}%
+}
+
+
+% Define a new plot mark for use with \pgfplotmark.
+%
+% #1 = a plot mark mnemonic
+% #2 = code for drawing the mark
+%
+% Example:
+%
+% \pgfdeclareplotmark{*}{\pgfpathcircle{\pgfpointorigin}{2pt}\pgfusepathqfill}
+
+\def\pgfdeclareplotmark#1#2{\expandafter\def\csname pgf@plot@mark@#1\endcsname{#2}}
+
+
+% Set the size of plot marks. For circles, this will be the radius,
+% for other shapes it should be about half the width/height.
+%
+% Example:
+%
+% \pgfsetplotmarksize{1pt}
+
+\def\pgfsetplotmarksize#1{\pgfmathsetlength\pgfplotmarksize{#1}}
+
+\newdimen\pgfplotmarksize
+\pgfplotmarksize=2pt
+
+
+% Insert a plot mark's code at the origin.
+%
+% #1 = plot mark mnemonic
+%
+% Example:
+%
+% \pgfuseplotmark{*}
+
+\def\pgfuseplotmark#1{\csname pgf@plot@mark@#1\endcsname}
+
+
+% A stroke-filled circle mark
+
+\pgfdeclareplotmark{*}
+{%
+ \pgfpathcircle{\pgfpointorigin}{\pgfplotmarksize}
+ \pgfusepathqfillstroke
+}
+
+
+% A plus-sign like mark
+
+\pgfdeclareplotmark{+}
+{%
+ \pgfpathmoveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}
+ \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}
+ \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}
+ \pgfusepathqstroke
+}
+
+
+% An x-shaped mark
+
+\pgfdeclareplotmark{x}
+{%
+ \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}
+ \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}
+ \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}
+ \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}
+ \pgfusepathqstroke
+}
+
+% See pgflibraryplotmarks for more plot marks
+
+
+
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex
new file mode 100644
index 00000000000..cb479f8dc73
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex
@@ -0,0 +1,2007 @@
+% Copyright 2008 by Christian Feuersaenger
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+%
+% This file contains methods for basic floating point arithmetics, rounding
+% to arbitrary precision and number pretty printing.
+%
+% Version 0.9.4 2008/03/18
+
+\global\newif\ifpgfmathfloatcomparison
+\newif\ifpgfmathfloatroundhasperiod
+\newif\ifpgfmathprintnumberskipzeroperiod
+
+
+% used internally in grouped macros:
+\toksdef\pgfmathfloat@tmptoks=1
+\newif\ifpgfmathfloat@fixed@digits@after@period
+\newif\ifpgfmathfloatroundmayneedrenormalize
+\toksdef\pgfmathfloat@a@Mtok=0
+
+%% WARNING: avoid conflicting register names!
+\let\pgfmathfloat@a@S=\c@pgf@counta
+\let\pgfmathfloat@a@M=\pgf@xa
+\let\pgfmathfloat@a@E=\c@pgf@countb
+\let\pgfmathfloat@b@S=\c@pgf@countc
+\let\pgfmathfloat@b@M=\pgf@xb
+\let\pgfmathfloat@b@E=\c@pgf@countd
+
+% can be changed with options.
+\def\pgfmathfloat@round@precision{2}
+
+
+% Computes a normalised floating point representation for #1 of the
+% form
+% [FLAGS] MANTISSE EXPONENT
+% meaning
+% [+-]X.XXXXXXX*10^C
+% where
+% X.XXXXXX is a mantisse with first number != 0, C is an integer and
+% FLAGS contains the sign and some other special cases.
+%
+% This method does NOT use TeX Registers to represent the numbers! The
+% computation is COMPLETELY STRING BASED.
+% This allows numbers such at 10000000 or 5.23e-10 to be represented
+% properly, although TeX-registers would produce overflow/underflow
+% errors in these cases.
+%
+% It is to be used to compute logs, because log(X*10^Y) = log(X) + log(10)*Y
+%
+% Arguments:
+% #1: an arbitrary number which shall be parsed. Maybe a macro.
+% Examples:
+% [+-]XXXXX.XXXXXX
+% [+-]XXXXX.XXXXXXeXXXX
+% [+-]0.0000XXXXXX
+% [+-]0.0000XXXXXXeXXXX
+% [+-]inf
+% nan
+% Maybe a macro containing such a number.
+%
+% Return value:
+% \pgfmathresult will be \def'ed to
+% FLAGS MANTISSE 'e' EXPONENT
+% where
+% FLAGS is a number in [0-5] where
+% 0 == '0' (the number is +- 0.0),
+% 1 == '+',
+% 2 == '-',
+% 3 == 'not a number'
+% 4 == '+ infinity'
+% 5 == '- infinity'
+%
+% MANTISSE is a normalised number 1 <= M < 10. It always contains a
+% period and at least one digit after the period.
+%
+% EXPONENT is an integer value.
+%
+% Example:
+% \pgfmathfloatparsenumber{1}
+% -> \pgfmathresult = 11.0e0
+% \pgfmathfloatparsenumber{141.212}
+% -> \pgfmathresult = 11.41212e2
+\def\pgfmathfloatparsenumber#1{%
+ \begingroup
+ \expandafter\pgfmathfloatparsenumber@impl#1\pgfmathfloat@EOI
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.0}%
+ \fi
+ \edef\pgfmathresult{%
+ \the\pgfmathfloat@a@S\the\pgfmathfloat@a@Mtok e\the\pgfmathfloat@a@E}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+% The same as \pgfmathfloatparsenumber, but does not perform sanity checking.
+\def\pgfmathfloatqparsenumber#1{%
+ \begingroup
+ \let\pgfmathfloatparsenumber@sanitize@digit=\relax
+ \expandafter\pgfmathfloatparsenumber@impl#1\pgfmathfloat@EOI
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.0}%
+ \fi
+ \edef\pgfmathresult{%
+ \the\pgfmathfloat@a@S\the\pgfmathfloat@a@Mtok e\the\pgfmathfloat@a@E}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+
+% decomposes a lowlevel floating point representation into flags,
+% mantisse and exponent.
+%
+% #4: integer register for the flags.
+% #5: dimen registers for the mantisse.
+% #6: integer register for the exponent.
+\def\pgfmathfloat@decompose#1#2e#3\relax#4#5#6{%
+ #4=#1\relax
+ #5=#2pt%
+ #6=#3\relax%
+}
+% overloaded, #5 needs to be a token register for the mantisse.
+\def\pgfmathfloat@decompose@tok#1#2e#3\relax#4#5#6{%
+ #4=#1\relax
+ #5={#2}%
+ #6=#3\relax%
+}
+% overloaded, returns only ONE of the three components into #4:
+\def\pgfmathfloat@decompose@F#1#2e#3\relax#4{#4=#1\relax}%
+\def\pgfmathfloat@decompose@M#1#2e#3\relax#4{#4=#2pt}%
+\def\pgfmathfloat@decompose@Mtok#1#2e#3\relax#4{#4={#2}}%
+\def\pgfmathfloat@decompose@E#1#2e#3\relax#4{#4=#3\relax}%
+
+% Takes a floating point number #1 as input and writes flags to macro
+% #2, mantisse to macro #3 and exponent to macro #4.
+\def\pgfmathfloattomacro#1#2#3#4{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \xdef\pgfmathfloat@TMPB{%
+ \noexpand\def\noexpand#2{\the\pgfmathfloat@a@S}%
+ \noexpand\def\noexpand#3{\the\pgfmathfloat@a@Mtok}%
+ \noexpand\def\noexpand#4{\the\pgfmathfloat@a@E}%
+ }%
+ \endgroup
+ \pgfmathfloat@TMPB
+}
+
+% Takes a floating point number #1 as input and writes flags to count
+% register #2, mantisse to dimen register #3 and exponent to count
+% register #4.
+\def\pgfmathfloattoregisters#1#2#3#4{%
+ \expandafter\pgfmathfloat@decompose#1\relax{#2}{#3}{#4}%
+}
+
+% the same, but writes the mantisse into a token register.
+\def\pgfmathfloattoregisterstok#1#2#3#4{%
+ \expandafter\pgfmathfloat@decompose@tok#1\relax{#2}{#3}{#4}%
+}
+
+% Extracts the flags of #1 into the count register #2.
+\def\pgfmathfloatgetflags#1#2{%
+ \expandafter\pgfmathfloat@decompose@F#1\relax{#2}%
+}
+% Extracts the mantisse of #1 into the dimen register #2.
+\def\pgfmathfloatgetmantisse#1#2{%
+ \expandafter\pgfmathfloat@decompose@M#1\relax{#2}%
+}
+% Extracts the mantisse of #1 into the token register #2.
+\def\pgfmathfloatgetmantissetok#1#2{%
+ \expandafter\pgfmathfloat@decompose@Mtok#1\relax{#2}%
+}
+% Extracts the exponent of #1 into the count register #2.
+\def\pgfmathfloatgetmantisse#1#2{%
+ \expandafter\pgfmathfloat@decompose@E#1\relax{#2}%
+}
+
+% Defines \pgfmathresult as the floating point number encoded by
+% the flags #1, mantisse #2 and exponent #3.
+%
+% All arguments are characters and will be expanded using '\edef'.
+\def\pgfmathfloatcreate#1#2#3{%
+ \edef\pgfmathresult{#1#2e#3}%
+}%
+
+
+% Compares #1 with #2 and sets \pgfmathresult either to 1.0 or 0.0.
+%
+% It also sets the boolean \ifpgfmathfloatcomparison (globally.
+\def\pgfmathfloatlessthan@#1#2{%
+%\def\pgfmathfloatlessthan#1#2#3\and#4#5#6{%
+ \global\pgfmathfloatcomparisonfalse
+ \begingroup
+ \expandafter\pgfmathfloat@decompose#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@M\pgfmathfloat@a@E
+ \expandafter\pgfmathfloat@decompose#2\relax\pgfmathfloat@b@S\pgfmathfloat@b@M\pgfmathfloat@b@E
+ \ifcase\pgfmathfloat@a@S
+ % x = 0 -> (x<y <=> y >0)
+ \ifnum1=\pgfmathfloat@b@S
+ \global\pgfmathfloatcomparisontrue
+ \fi
+ \or
+ % x > 0 -> (x<y <=> ( y > 0 && |x| < |y|) )
+ \ifnum1=\pgfmathfloat@b@S
+ % y>0:
+ \pgfmathfloatlessthan@positive
+ \fi
+ \or
+ % x < 0 -> (x<y <=> (y >= 0 || |x| > |y|) )
+ \ifnum2=\pgfmathfloat@b@S
+ % 'y<0':
+ \pgfmathfloatgreaterthan@positive
+ \else
+ \global\pgfmathfloatcomparisontrue
+ \fi
+ \else
+ \pgfmath@error{Sorry, 'pgfmathfloatlessthan@{#1}{#2}' not yet supported.}%
+ \fi
+ \endgroup
+ \ifpgfmathfloatcomparison
+ \def\pgfmathresult{1.0}%
+ \else
+ \def\pgfmathresult{0.0}%
+ \fi
+}
+\let\pgfmathfloatlessthan=\pgfmathfloatlessthan@
+
+% compares \pgfmathfloat@a@[SME] < \pgfmathfloat@b@[SME]
+\def\pgfmathfloatlessthan@positive{%
+ \ifnum\pgfmathfloat@a@E<\pgfmathfloat@b@E
+ \global\pgfmathfloatcomparisontrue
+ \else
+ \ifnum\pgfmathfloat@a@E=\pgfmathfloat@b@E
+ \ifdim\pgfmathfloat@a@M<\pgfmathfloat@b@M
+ \global\pgfmathfloatcomparisontrue
+ \fi
+ \fi
+ \fi
+}
+
+% compares \pgfmathfloat@a@[SME] > \pgfmathfloat@b@[SME]
+\def\pgfmathfloatgreaterthan@positive{%
+ \ifnum\pgfmathfloat@a@E>\pgfmathfloat@b@E
+ \global\pgfmathfloatcomparisontrue
+ \else
+ \ifnum\pgfmathfloat@a@E=\pgfmathfloat@b@E
+ \ifdim\pgfmathfloat@a@M>\pgfmathfloat@b@M
+ \global\pgfmathfloatcomparisontrue
+ \fi
+ \fi
+ \fi
+}
+
+
+\def\pgfmathfloatmax@#1#2{%
+ \pgfmathfloatlessthan{#1}{#2}%
+ \ifpgfmathfloatcomparison
+ \edef\pgfmathresult{#2}%
+ \else
+ \edef\pgfmathresult{#1}%
+ \fi
+}
+\let\pgfmathfloatmax=\pgfmathfloatmax@
+
+\def\pgfmathfloatmin@#1#2{%
+ \pgfmathfloatlessthan{#1}{#2}%
+ \ifpgfmathfloatcomparison
+ \edef\pgfmathresult{#1}%
+ \else
+ \edef\pgfmathresult{#2}%
+ \fi
+}
+\let\pgfmathfloatmin=\pgfmathfloatmin@
+
+% Renormalizes #1 to extended precision mantisse, meaning
+% 100 <= m < 1000
+% instead of 1 <= m < 10.
+%
+% The 'extended precision' means we have higher accuracy when we apply pgfmath operations to mantisses.
+%
+% The input argument is expected to be a normalized floating point number; the output argument is a non-normalized floating point number (well, normalized to extended precision).
+%
+% The operation is supposed to be very fast.
+\def\pgfmathfloattoextentedprecision#1{%
+ \begingroup
+ \pgfmathfloattoextentedprecision@a{#1}%
+ \pgfmathfloatcreate{\pgfmathfloat@a@S}{\pgfmathresult}{\pgfmathfloat@a@E}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+% Does the same work as \pgfmathfloattoextentedprecision, but this one here fills the
+% registers \pgfmathfloat@a@S and \pgfmathfloat@a@E with the flags and (renormalized) exponent.
+% It destroys the content of \pgfmathfloat@a@Mtok.
+\def\pgfmathfloattoextentedprecision@a#1{%
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifnum\pgfmathfloat@a@S<3
+ \advance\pgfmathfloat@a@E by-2\relax% compensate for shift above
+ \expandafter\pgfmathfloattoextentedprecision@@\the\pgfmathfloat@a@Mtok 00\pgfmathfloat@EOI
+ \else
+ \edef\pgfmathresult{#1}%
+ \fi
+}%
+\def\pgfmathfloattoextentedprecision@@#1.#2#3#4\pgfmathfloat@EOI{%
+ \edef\pgfmathresult{#1#2#3.#4}%
+}%
+
+
+% Similar to \pgfmathfloattoextentedprecision@a, this one here fills the '@b' registers.
+\def\pgfmathfloattoextentedprecision@b#1{%
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@b@S\pgfmathfloat@a@Mtok\pgfmathfloat@b@E
+ \ifnum\pgfmathfloat@b@S<3
+ \advance\pgfmathfloat@b@E by-2\relax
+ \expandafter\pgfmathfloattoextentedprecision@@\the\pgfmathfloat@a@Mtok 00\pgfmathfloat@EOI
+ \else
+ \edef\pgfmathresult{#1}%
+ \fi
+}%
+
+% Addition of two floating point numbers using 8 significant digits.
+\def\pgfmathfloatadd@#1#2{%
+ \begingroup
+ %
+ % renormalize argument to 100 <= m < 1000 for extended accuracy:
+ \pgfmathfloattoextentedprecision@a{#1}%
+ \let\pgfmathfloat@arga=\pgfmathresult
+ %
+ \pgfmathfloattoextentedprecision@b{#2}%
+ \let\pgfmathfloat@argb=\pgfmathresult
+ %
+ \pgfmathfloatcomparisontrue% re-use this boolean here to handle special cases.
+ \ifcase\pgfmathfloat@a@S
+ \edef\pgfmathresult{#2}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \or
+ \edef\pgfmathfloat@arga{-\pgfmathfloat@arga}%
+ \else
+ \pgfmathfloatcomparisonfalse
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{0.0}{0}%
+ \fi
+ \ifcase\pgfmathfloat@b@S
+ \edef\pgfmathresult{#1}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \or
+ \edef\pgfmathfloat@argb{-\pgfmathfloat@argb}%
+ \else
+ \pgfmathfloatcomparisonfalse
+ \pgfmathfloatcreate{\the\pgfmathfloat@b@S}{0.0}{0}%
+ \fi
+ \ifpgfmathfloatcomparison
+ % Shift lesser mantisse to fit the larger one:
+ \ifnum\pgfmathfloat@a@E<\pgfmathfloat@b@E
+ \pgfmathfloatadd@shift{\pgfmathfloat@arga}{\pgfmathfloat@a@E}{\pgfmathfloat@b@E}%
+ \else
+ \pgfmathfloatadd@shift{\pgfmathfloat@argb}{\pgfmathfloat@b@E}{\pgfmathfloat@a@E}%
+ \fi
+ % add them!
+ \pgfmathadd@{\pgfmathfloat@arga}{\pgfmathfloat@argb}%
+ % renormalize sum. This is the only part were an expensive routine comes into play:
+ \edef\pgfmathresult{\pgfmathresult e\the\pgfmathfloat@a@E}%
+ \expandafter\pgfmathfloatqparsenumber\expandafter{\pgfmathresult}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+
+% #1=mantisse which needs to be shifted (with smaller exponent)
+% #2=smaller exponent
+% #3=larger exponent
+%
+% ATTENTION: this helper method DESTROYS contents of \pgfmathfloat@a@S.
+\def\pgfmathfloatadd@shift#1#2#3{%
+ \pgf@xa=#1 pt
+ \pgfmathfloat@a@S=#3
+ \advance\pgfmathfloat@a@S by-#2
+ \ifcase\pgfmathfloat@a@S
+ \or
+ \divide\pgf@xa by10\relax
+ \or
+ \divide\pgf@xa by100\relax
+ \or
+ \divide\pgf@xa by1000\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \divide\pgf@xa by10\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \divide\pgf@xa by100\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \divide\pgf@xa by1000\relax
+ \or
+ \divide\pgf@xa by10000\relax
+ \divide\pgf@xa by10000\relax
+ \else
+ \pgf@xa=0pt
+ \fi
+ #2=#3
+ \edef#1{\pgf@sys@tonumber\pgf@xa}%
+}
+
+\let\pgfmathfloatadd=\pgfmathfloatadd@
+
+
+% Subtracts two floating point numbers.
+\def\pgfmathfloatsubtract@#1#2{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#2\relax\pgfmathfloat@b@S\pgfmathfloat@a@Mtok\pgfmathfloat@b@E
+ \ifcase\pgfmathfloat@b@S
+ \edef\pgfmathresult{#1}%
+ \or
+ \pgfmathfloatcreate{2}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@b@E}%
+ \let\pgfmathfloatsub@arg=\pgfmathresult
+ \pgfmathfloatadd@{#1}{\pgfmathfloatsub@arg}%
+ \or
+ \pgfmathfloatcreate{1}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@b@E}%
+ \let\pgfmathfloatsub@arg=\pgfmathresult
+ \pgfmathfloatadd@{#1}{\pgfmathfloatsub@arg}%
+ \else
+ \pgfmathfloatcreate{\the\pgfmathfloat@b@S}{0.0}{0}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+\let\pgfmathfloatsubtract=\pgfmathfloatsubtract@
+
+% Scales a floating point number #1 with a fixed point number #2 using pgfmathmultiply.
+%
+% Use this method if #2 is small number.
+\def\pgfmathfloatmultiplyfixed@#1#2{%
+ \begingroup
+ %
+ % renormalize argument to 100 <= m < 1000 for extended accuracy:
+ \pgfmathfloattoextentedprecision@a{#1}%
+ \let\pgfmathfloat@arga=\pgfmathresult
+ %
+ \pgfmathfloatcomparisontrue% re-use this boolean here to handle special cases.
+ \ifcase\pgfmathfloat@a@S
+ \edef\pgfmathresult{#1}%
+ \pgfmathfloatcomparisonfalse
+ \or
+ \or
+ \edef\pgfmathfloat@arga{-\pgfmathfloat@arga}%
+ \else
+ \pgfmathfloatcomparisonfalse
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{0.0}{0}%
+ \fi
+ \ifpgfmathfloatcomparison
+ \pgfmathmultiply@{\pgfmathfloat@arga}{#2}%
+ % renormalize product. This is the only part were an expensive routine comes into play:
+ \edef\pgfmathresult{\pgfmathresult e\the\pgfmathfloat@a@E}%
+ \expandafter\pgfmathfloatqparsenumber\expandafter{\pgfmathresult}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+\let\pgfmathfloatmultiplyfixed=\pgfmathfloatmultiplyfixed@
+
+% Converts a composed floating point representation to fixed point.
+%
+% Example:
+% \pgfmathfloattofixed{142e1}
+% -> \pgfmathresult = 42.0
+\def\pgfmathfloattofixed@#1{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S
+ \def\pgfmathresult{0.0}%
+ \or
+ \expandafter\pgfmathfloattofixed@impl\the\pgfmathfloat@a@Mtok\relax
+ \or
+ \expandafter\pgfmathfloattofixed@impl\the\pgfmathfloat@a@Mtok\relax
+ \edef\pgfmathresult{-\pgfmathresult}%
+ \or\def\pgfmathresult{nan}%
+ \or\def\pgfmathresult{inf}%
+ \or\def\pgfmathresult{-inf}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\let\pgfmathfloattofixed=\pgfmathfloattofixed@
+
+% Divides or multiplies the input number by 10^#4 using an arithmetic
+% left/right shift.
+%
+% Input:
+% #1 a normalised floating point number.
+% #2 a positive or negative integer number denoting the shift.
+%
+% Example:
+% \pgfmathfloatshift{11e3}{4}%
+% -> pgfmathresult = 11e7
+\def\pgfmathfloatshift@#1#2{%
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \expandafter\advance\expandafter\pgfmathfloat@a@E#2\relax
+ \edef\pgfmathresult{\the\pgfmathfloat@a@S\the\pgfmathfloat@a@Mtok e\the\pgfmathfloat@a@E}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\let\pgfmathfloatshift=\pgfmathfloatshift@
+
+% Computes a good guess for log(X.XXXX) where the input number should
+% be between 0 < x < 10.
+%
+% If it is not in this range, the returned value will be bad.
+%
+% For use in the newton implementation of log(x). Please note that we
+% first compute a normalized floating point representation of x, and
+% the mantisse is always between 0 and 10.
+\def\pgfmathlog@smaller@ten@newton@startval#1.#2\to#3{%
+ \ifcase#1
+ \pgfmath@error{pgfmathlog@newton: INTERNAL ERROR: should not happen!
+ [\#1=0 should have been caught before!]}%
+ \or#3=0.530628pt
+ \or#3=0.993pt
+ \or#3=1.308pt
+ \or#3=1.5pt
+ \or#3=1.71pt
+ \or#3=1.872pt
+ \or#3=2.01pt
+ \or#3=2.145pt
+ \or#3=2.24pt
+ \fi
+}
+
+% FIXME : eliminate \pgfmathlog@invoke@expanded ?
+
+% Expands #2 using \edef and invokes #1 with the resulting string.
+%
+% Example:
+% \pgfmath@y=7.9pt
+% \pgfmathlog@invoke@expanded\pgfmathexp@{{\pgf@sys@tonumber{\pgfmath@y}}}%
+% will invoke
+% \pgfmathexp@{7.9}
+\def\pgfmathlog@invoke@expanded#1#2{%
+ \edef\pgfmath@resulttemp{#2}%
+ \expandafter#1\pgfmath@resulttemp
+}
+
+% This implementation of log(X) is done with a newton method applied to x-exp(y) = 0.
+% The implementation \pgfmathexp is used for exp(y).
+%
+% see \pgfmathlog@
+\def\pgfmathlog@newton#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \pgfmathlog@newton@float{\pgfmathresult}%
+}
+
+% the same as \pgfmathlog@newton, but this one takes a floating point number as input.
+\def\pgfmathlog@newton@float#1{%
+ \begingroup%
+ % compute #1 = M*10^E with normalised mantisse M = [+-]*[1-9].XXXXX
+ \expandafter\pgfmathfloat@decompose#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@M\pgfmathfloat@a@E
+ \let\pgfmathlog@loopcount=\pgfmathfloat@b@S% this counter is not used here... use it as loop counter.
+ %
+ \ifnum\pgfmathfloat@a@S=1
+ % Now, compute log(#1) = log(M) + E*log(10)
+ \expandafter\pgfmathlog@smaller@ten@newton@startval\the\pgfmathfloat@a@M.\to\pgfmathfloat@b@M
+ \pgfmathlog@loopcount=0
+ \loop
+ \ifnum\pgfmathlog@loopcount<3
+ \pgfmathlog@invoke@expanded\pgfmathexp@{{\pgf@sys@tonumber{\pgfmathfloat@b@M}}}%
+ \let\pgfmathlog@tmp=\pgfmathresult
+ \pgfmathlog@invoke@expanded\pgfmathdivide@{{\pgf@sys@tonumber{\pgfmathfloat@a@M}}{\pgfmathlog@tmp}}%
+ \expandafter\pgfmath@ya\pgfmathresult pt
+ \advance\pgfmathfloat@b@M by\pgfmath@ya
+ \advance\pgfmathfloat@b@M by-1pt
+ \advance\pgfmathlog@loopcount by1
+ \repeat
+ \pgfmathfloat@a@M=2.302585pt% = log(10)
+ \multiply\expandafter\pgfmathfloat@a@M\pgfmathfloat@a@E
+ \advance\pgfmathfloat@b@M by\pgfmathfloat@a@M
+ \edef\pgfmathresult{\pgf@sys@tonumber{\pgfmathfloat@b@M}}%
+ \else
+ \let\pgfmathresult=\pgfutil@empty%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup%
+}
+
+% Computes log(x) into \pgfmathresult.
+%
+% REMARK
+% This method does NOT use TeX Registers to represent the numbers! The
+% computation is COMPLETELY STRING BASED.
+% This allows numbers such at 10000000 or 5.23e-10 to be represented
+% properly, although TeX-registers would produce overflow/underflow
+% errors in these cases.
+%
+% The natural logarithm is computed using log(X*10^Y) = log(X) + log(10)*Y
+\let\pgfmathlog@=\pgfmathlog@newton
+
+\let\pgfmathlog@float=\pgfmathlog@newton@float
+
+% Public interface method. This is expected to use \pgfmathparse but
+% it DOESN'T do that. \pgfmathparse naturally can't handle numbers
+% which exceed TeX's numerical capabilities. However, exponentials are
+% typically either too large or too small for TeX.
+%
+% @see \pgfmathnormalisedfloatingpoint for how we parse arguments.
+% @see \pgfmathlog@
+\let\pgfmathlog=\pgfmathlog@newton
+
+% Rounds a fixed point number #1 to \pgfmathfloat@round@precision digits precision and returns
+% the result into \pgfmathresult.
+%
+% Any trailing zeros after the period are discarded.
+% See \pgfmathroundtozerofill if you want trailing zeros and fixed
+% width.
+%
+% This method is PURELY text based and can work with arbirtrary
+% precision (well, limited to TeX's stack size and integer size).
+%
+% Examples:
+% \pgfmathroundto{1}
+% -> \pgfmathresult = '1'
+%
+% \pgfmathroundto{19999.9996}
+% -> \pgfmathresult = '20000'
+%
+% Arguments:
+% #1 may be either a number or a macro expanding to a number.
+%
+% SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set.
+\def\pgfmathroundto#1{%
+ \pgfmathfloatroundhasperiodtrue
+ \begingroup
+ \pgfmathfloat@fixed@digits@after@periodfalse
+ \pgfmathroundto@impl{#1}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+
+% Overloaded method.
+%
+% This variant always uses a FIXED number behind the period and fills
+% in zeros if necessary.
+% Examples:
+% \pgfmathroundtozerofill{1}
+% -> \pgfmathresult = '1.00'
+%
+% \pgfmathroundtozerofill{19999.9996}
+% -> \pgfmathresult = '20000.00'
+%
+% SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set.
+\def\pgfmathroundtozerofill#1{%
+ \pgfmathfloatroundhasperiodtrue
+ \begingroup
+ \pgfmathfloat@fixed@digits@after@periodtrue
+ \pgfmathroundto@impl{#1}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+\def\pgfmathprintnumber@fixed@styleDEFAULT#1#2#3e#4\relax{%
+ \begingroup
+ \pgfkeysgetvalue{/pgf/number format/set decimal separator}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP
+ \pgfkeysgetvalue{/pgf/number format/set thousands separator}\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP
+ \c@pgf@counta=#4\relax
+ \def\pgfmathresult{}%
+ \ifpgfmathfloatroundhasperiod
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@period#1\pgfmathfloat@EOI
+ \else
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@period#1.#2\pgfmathfloat@EOI{%
+ \ifpgfmathprintnumberskipzeroperiod
+ \def\pgfmathfloat@TMPB{#1}%
+ \ifx\pgfmathfloatparsenumber@tok@ZERO\pgfmathfloat@TMPB
+ \else
+ \def\pgfmathfloat@TMPC{-0}%
+ \ifx\pgfmathfloat@TMPC\pgfmathfloat@TMPB
+ \def\pgfmathresult{-}%
+ \else
+ \def\pgfmathfloat@TMPC{+0}%
+ \ifx\pgfmathfloat@TMPC\pgfmathfloat@TMPB
+ \def\pgfmathresult{+}%
+ \else
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI
+ \fi
+ \fi
+ \fi
+ \else
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI
+ \fi
+ \begingroup
+ \toks0=\expandafter{\pgfmathresult}%
+ \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP #2}%
+ \xdef\pgfmathfloat@TMPB{\the\toks0\the\toks1}%
+ \endgroup
+ \let\pgfmathresult=\pgfmathfloat@TMPB
+}%
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod{%
+ \ifx\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP\pgfutil@empty
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall}%
+ \else
+ \ifnum\c@pgf@counta<0\relax
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall}%
+ \else
+ \advance\c@pgf@counta by1% counta:= total number of digits, N.
+ \c@pgf@countb=\c@pgf@counta
+ \divide\c@pgf@countb by3% countb := N DIV 3
+ \c@pgf@countc=\c@pgf@countb
+ \multiply\c@pgf@countc by3
+ \advance\c@pgf@counta by-\c@pgf@countc% now counta := N MOD 3
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printsign
+ }%
+ \fi
+ \fi
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printsign#1{%
+ \def\pgfmathfloat@TMPB{#1}%
+ \ifx\pgfmathfloat@TMPB\pgfmathfloatparsenumber@tok@MINUS
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}% FIXME: '-' is enough!?
+ \let\pgfmathfloat@TMPB=\pgfutil@empty
+ \else
+ \ifx\pgfmathfloat@TMPB\pgfmathfloatparsenumber@tok@PLUS
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}% FIXME: '+' is enough?
+ \let\pgfmathfloat@TMPB=\pgfutil@empty
+ \fi\fi
+ \ifnum\c@pgf@counta>0
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printtrailingdigits\pgfmathfloat@TMPB
+ }%
+ \else
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \expandafter\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird\pgfmathfloat@TMPB
+ }%
+ \fi
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printtrailingdigits#1#2{%
+ \ifcase\c@pgf@counta
+ \or
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}%
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird#2%
+ }%
+ \or
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1#2}%
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird%
+ }%
+ \fi
+ \ifnum\c@pgf@countb>0\relax
+ \begingroup
+ \toks0=\expandafter{\pgfmathresult}%
+ \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP}%
+ \xdef\pgfmathfloat@TMPB{\the\toks0\the\toks1}%
+ \endgroup
+ \let\pgfmathresult=\pgfmathfloat@TMPB
+ \fi
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird#1#2#3{%
+ \ifnum\c@pgf@countb>0\relax
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1#2#3}%
+ \advance\c@pgf@countb by-1
+ \ifnum\c@pgf@countb>0\relax
+ \begingroup
+ \toks0=\expandafter{\pgfmathresult}%
+ \toks1=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@THOUSAND@SEP}%
+ \xdef\pgfmathfloat@TMPB{\the\toks0\the\toks1}%
+ \endgroup
+ \let\pgfmathresult=\pgfmathfloat@TMPB
+ \fi
+ \def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT{%
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@counteverythird%
+ }%
+ \else
+ % in thise case, #1#2#3 are expected to be
+ % \pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI
+ \def\pgfmathfloat@TMPB{\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI}%
+ \def\pgfmathfloat@TMPC{#1#2#3}%
+ \ifx\pgfmathfloat@TMPC\pgfmathfloat@TMPB
+ \else
+ \pgfmath@error{INTERNAL ERROR in fixed style - The input sequence did not terminate as expected; which indicates a wrong exponent argument provided to \string\pgfmathprintnumber@fixed@style}%
+ \fi
+ \let\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT=\relax
+ \fi
+ \pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@NEXT
+}
+\def\pgfmathprintnumber@fixed@styleDEFAULT@impl@noperiod@printall#1\pgfmathfloat@EOI\pgfmathfloat@EOI\pgfmathfloat@EOI{%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #1}%
+}%
+
+% #1 maybe a macro
+\def\pgfmathprintnumber@fixed@stylePERIOD#1#2#3e#4\relax{%
+ \def\pgfmathresult{#1}%
+}
+
+% #1 maybe a macro
+\def\pgfmathprintnumber@fixed@styleCOMMA#1#2#3e#4\relax{%
+ \ifpgfmathfloatroundhasperiod
+ \expandafter\pgfmathprintnumber@fixed@styleCOMMA@impl#1\pgfmathfloat@EOI
+ \else
+ \def\pgfmathresult{#1}%
+ \fi
+}
+\def\pgfmathprintnumber@fixed@styleCOMMA@impl#1.#2\pgfmathfloat@EOI{\def\pgfmathresult{#1{,}#2}}
+
+% The default style to display fixed point numbers.
+%
+% It does not apply numerics, but it is responsable to typeset the
+% rounded number.
+% It can access the \ifpgfmathfloatroundhasperiod boolean.
+%
+% Arguments:
+% #1#2#3e#4\relax
+
+% Input:
+% #1 the fixed point number to be displayed (maybe a macro).
+% #2#3e#4: the (possibly unformatted) floating point representation which belongs to #1.
+% It is used to determine sign and exponent.
+\let\pgfmathprintnumber@fixed@style=\pgfmathprintnumber@fixed@styleDEFAULT
+
+
+% Rounds a normalized floating point number to \pgfmathfloat@round@precision
+% digits precision and writes the result to \pgfmathresult.
+%
+% This method uses \pgfmathroundto for the mantisse.
+%
+% @see pgfmathfloatroundzerofill
+%
+% SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set to
+% whether the final mantisse #5 has a period or not.
+\def\pgfmathfloatround#1{%
+ \pgfmathfloatroundhasperiodtrue
+ \begingroup
+ \pgfmathfloat@fixed@digits@after@periodfalse
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \pgfmathfloatround@impl
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+% Overload.
+%
+% This method uses a fixed width for the mantisse and fills in zeros
+% if necessary.
+%
+% This method uses \pgfmathroundtozerofill for the mantisse.
+%
+% SIDE EFFECT: the global variable \ifpgfmathfloatroundhasperiod will be set to
+% whether the final mantisse #5 has a period or not.
+\def\pgfmathfloatroundzerofill#1{%
+ \pgfmathfloatroundhasperiodtrue
+ \begingroup
+ \pgfmathfloat@fixed@digits@after@periodtrue
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \pgfmathfloatround@impl
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+\newif\ifpgfmathfloatround@allow@empty@mantisse
+\def\pgfmathfloatround@mantisse@ONE{1.0}%
+
+% #1: sign
+% #2: mantisse
+% #3: exponent
+% #4: CODE to display if the mantisse is drawn.
+% #5: CODE to display if the mantisse is NOT draw.
+% #6: CODE to display the exponent.
+\def\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax#4#5#6{%
+ \expandafter\ifcase#1\relax
+ \pgfmathprintnumber@fixed@style{#2}#1#2e0\relax%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #4#6}%
+ \or\pgfmathprintnumber@fixed@style{#2}#1#2e0\relax%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\pgfmathresult #4#6}%
+ \or\pgfmathprintnumber@fixed@style{#2}#1#2e0\relax%
+ \expandafter\def\expandafter\pgfmathresult\expandafter{\expandafter-\pgfmathresult #4#6}%
+ \or\def\pgfmathresult{NaN}%
+ \or\def\pgfmathresult{\infty}%
+ \or\def\pgfmathresult{-\infty}%
+ \fi
+}
+
+\def\pgfmathfloatrounddisplaystyle@std#1#2e#3\relax{%
+ \pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{\cdot}{}{10^{#3}}%
+}
+\def\pgfmathfloatrounddisplaystyle@subscript#1#2e#3\relax{%
+ \pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{}{1}{_{#3}}%
+}
+\def\pgfmathfloatrounddisplaystyle@e#1#2e#3\relax{%
+ \ifnum#3<0\relax
+ {\count0=#3\relax
+ \multiply\count0 by-1
+ \xdef\pgfmathfloat@TMPB{e{-}\the\count0}%
+ }%
+ \let\pgfmathresult=\pgfmathfloat@TMPB
+ \else
+ \def\pgfmathresult{e{+}#3}%
+ \fi
+ \def\pgfmathfloat@TMPB{\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{}{1}}%
+ \expandafter\pgfmathfloat@TMPB\expandafter{\pgfmathresult}%
+}
+\def\pgfmathfloatrounddisplaystyle@E#1#2e#3\relax{%
+ \ifnum#3<0\relax
+ {\count0=#3\relax
+ \multiply\count0 by-1
+ \xdef\pgfmathfloat@TMPB{E{-}\the\count0}%
+ }%
+ \let\pgfmathresult=\pgfmathfloat@TMPB
+ \else
+ \def\pgfmathresult{E{+}#3}%
+ \fi
+ \def\pgfmathfloat@TMPB{\pgfmathfloatrounddisplaystyle@shared@impl#1#2e#3\relax{}{1}}%
+ \expandafter\pgfmathfloat@TMPB\expandafter{\pgfmathresult}%
+}
+
+% A macro which takes three arguments, sign, mantisse and exponent and
+% expands to the final TeX-representation for that floating point
+% number.
+%
+% PRECONDITION:
+% the floating point number has already been rounded properly and
+% the mantisse has been rounded correcty.
+%
+% #1: SIGN
+% #2: MANTISSE
+% #3: EXPONENT
+\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@std
+\newif\ifpgfmathfloat@usezerofill@sci
+\newif\ifpgfmathfloat@usezerofill@fixed
+\newif\ifpgfmathprintnumber@assumemathmode
+
+\pgfkeys{%
+ /pgf/number format/.is family,
+ /pgf/number format,
+ fixed/.code= \pgfmath@set@number@printer{pgfmathprintnumber@FIXED},
+ %fixed zerofill/.code= \pgfmath@set@number@printer{pgfmathprintnumber@FIXED@ZEROFILL},
+ %sci zerofill/.code= \pgfmath@set@number@printer{pgfmathprintnumber@SCI@ZEROFILL},
+ sci/.code= \pgfmath@set@number@printer{pgfmathprintnumber@SCI},
+ std/.code= \pgfmath@set@number@printer{pgfmathprintnumber@STD},
+ int detect/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@DETECT},
+ int trunc/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@TRUNC},
+ assume math mode/.is if=pgfmathprintnumber@assumemathmode,
+ assume math mode/.default=true,
+ fixed zerofill/.is if= pgfmathfloat@usezerofill@fixed,
+ fixed zerofill/.default=true,
+ sci zerofill/.is if= pgfmathfloat@usezerofill@sci,
+ sci zerofill/.default=true,
+ zerofill/.style= {/pgf/number format/fixed zerofill=#1,/pgf/number format/sci zerofill=#1},
+ zerofill/.default= true,
+ precision/.store in= \pgfmathfloat@round@precision,
+ fixed default/.code= {\let\pgfmathprintnumber@fixed@style=\pgfmathprintnumber@fixed@styleDEFAULT},
+ set decimal separator/.initial=,
+ dec sep/.style={/pgf/number format/set decimal separator=#1},
+ set thousands separator/.initial=,
+ 1000 sep/.style={/pgf/number format/set thousands separator=#1},
+ use period/.style= {/pgf/number format/set decimal separator={.},/pgf/number format/set thousands separator={{{,}}}},
+ use comma/.style= {/pgf/number format/set decimal separator={{{,}}},/pgf/number format/set thousands separator={.}},
+ skip 0./.is if=pgfmathprintnumberskipzeroperiod,
+ skip 0./.default=true,
+ skip 0.= false,
+ use period,
+ sci 10^e/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@std},
+ sci 10e/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@std},
+ sci e/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@e},
+ sci E/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@E},
+ sci subscript/.code= {\let\pgfmathfloatrounddisplaystyle=\pgfmathfloatrounddisplaystyle@subscript},
+% sci may skip mantisse/.is if=pgfmathfloatround@allow@empty@mantisse,
+% sci may skip mantisse/.default=true,
+}
+
+
+
+\def\pgfmathprintnumber@STD#1{%
+ % parse the input:
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmathprintnumber@STD@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@STD@issci#1#2e#3\relax{%
+ \expandafter\ifnum#1<3
+ \expandafter\ifnum#3>4
+ \pgfmathprintnumber@SCI@issci#1#2e#3\relax%
+ \else
+ \begingroup
+ \c@pgf@counta=\pgfmathfloat@round@precision\relax
+ \divide\c@pgf@counta by-2\relax
+ \ifnum#3<\c@pgf@counta
+ \pgfmathprintnumber@SCI@issci#1#2e#3\relax%
+ \else
+ \pgfmathprintnumber@FIXED@issci#1#2e#3\relax%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ \fi
+ \else% nan or inf:
+ \pgfmathfloatrounddisplaystyle#1#2e#3\relax%
+ \fi
+}
+
+
+\def\pgfmathprintnumber@INT@TRUNC#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmathprintnumber@INT@TRUNC@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@INT@TRUNC@impl#1.#2\relax#3#4e#5\relax{%
+ \pgfmathfloatroundhasperiodfalse
+ \pgfmathprintnumber@fixed@style{#1}#3#4e#5\relax%
+}
+\def\pgfmathprintnumber@INT@TRUNC@issci#1#2e#3\relax{%
+ \ifnum#1<3\relax
+ \pgfmathfloattofixed{#1#2e#3}%
+ \expandafter\pgfmathprintnumber@INT@TRUNC@impl\pgfmathresult\relax#1#2e#3\relax
+ \else
+ \pgfmathfloatrounddisplaystyle#1#2e#3\relax%
+ \fi
+}
+
+
+\def\pgfmathprintnumber@INT@DETECT#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmathprintnumber@INT@DETECT@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@INT@DETECT@issci#1#2e#3\relax{%
+ \begingroup
+ \ifnum#1<3\relax
+ \pgfmathfloattofixed{#1#2e#3}%
+ \def\pgfmathfloat@round@precision{6}%
+ \expandafter\pgfmathroundto\expandafter{\pgfmathresult}%
+ \ifpgfmathfloatroundhasperiod
+ \pgfmathprintnumber@SCI@issci#1#2e#3\relax
+ \else
+ \expandafter\pgfmathprintnumber@fixed@style\expandafter{\pgfmathresult}#1#2e#3\relax
+ \fi
+ \else
+ \pgfmathfloatrounddisplaystyle#1#2e#3\relax%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+\def\pgfmathprintnumber@FIXED#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmathprintnumber@FIXED@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@FIXED@issci#1#2e#3\relax{%
+ \begingroup
+ \ifnum#1<3
+ \pgfmathfloattofixed{#1#2e#3}%
+ \ifpgfmathfloat@usezerofill@fixed
+ \expandafter\pgfmathroundtozerofill\expandafter{\pgfmathresult}%
+ \else
+ \expandafter\pgfmathroundto\expandafter{\pgfmathresult}%
+ \fi
+ \ifpgfmathfloatroundmayneedrenormalize
+ \pgfmathfloat@a@E=#3\relax
+ \advance\pgfmathfloat@a@E by1
+ \edef\pgfmathfloat@TMPB{\noexpand\pgfmathprintnumber@fixed@style{\pgfmathresult}#1#2e\the\pgfmathfloat@a@E}%
+ \pgfmathfloat@TMPB\relax%
+ \else
+ \expandafter\pgfmathprintnumber@fixed@style\expandafter{\pgfmathresult}#1#2e#3\relax%
+ \fi
+ \else% nan or inf:
+ \pgfmathfloatrounddisplaystyle#1#2e#3\relax%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+
+\def\pgfmathprintnumber@SCI#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmathprintnumber@SCI@issci\pgfmathresult\relax
+}
+
+\def\pgfmathprintnumber@SCI@issci#1#2e#3\relax{%
+ \ifpgfmathfloat@usezerofill@sci
+ \pgfmathfloatroundzerofill{#1#2e#3}%
+ \else
+ \pgfmathfloatround{#1#2e#3}%
+ \fi
+ \expandafter\pgfmathfloatrounddisplaystyle\pgfmathresult\relax
+}
+
+% Prints argument #1 using the current pretty printer environment (all
+% variables in /pgf/number format).
+%
+% You may specify optional arguments with \pgfmathprintnumber[...].
+\def\pgfmathprintnumber{%
+ \pgfutil@ifnextchar[%
+ {\pgfmathprintnumber@OPT}%
+ {\pgfmathprintnumber@noopt}%
+}
+
+\def\pgfmathprintnumber@noopt#1{%
+ \pgfmathprintnumber@{#1}%
+ \ifpgfmathprintnumber@assumemathmode
+ \else
+ \pgfutilensuremath{\pgfmathresult}%
+ \fi
+}%
+\def\pgfmathprintnumber@OPT[#1]#2{%
+ \begingroup
+ \pgfqkeys{/pgf/number format}{#1}%
+ \pgfmathprintnumber@{#2}%
+ \ifpgfmathprintnumber@assumemathmode
+ \else
+ \pgfutilensuremath{\pgfmathresult}%
+ \fi
+ \endgroup
+}%
+
+% As \pgfmathprintnumber, but it produces its output into the second
+% argument.
+\def\pgfmathprintnumberto{%
+ \pgfutil@ifnextchar[%
+ {\pgfmathprintnumberto@OPT}%
+ {\pgfmathprintnumberto@noopt}%
+}
+
+\def\pgfmathprintnumberto@noopt#1#2{%
+ \begingroup
+ \pgfmathprintnumber@{#1}%
+ \ifpgfmathprintnumber@assumemathmode
+ \global\let\pgfmathfloat@TMPB=\pgfmathresult
+ \else
+ \toks0=\expandafter{\pgfmathresult}%
+ \xdef\pgfmathfloat@TMPB{\noexpand\pgfutilensuremath{\the\toks0}}%
+ \fi
+ \endgroup
+ \let#2=\pgfmathfloat@TMPB
+}%
+\def\pgfmathprintnumberto@OPT[#1]#2#3{%
+ \begingroup
+ \pgfqkeys{/pgf/number format}{#1}%
+ \pgfmathprintnumber@{#2}%
+ \ifpgfmathprintnumber@assumemathmode
+ \global\let\pgfmathfloat@TMPB=\pgfmathresult
+ \else
+ \toks0=\expandafter{\pgfmathresult}%
+ \xdef\pgfmathfloat@TMPB{\noexpand\pgfutilensuremath{\the\toks0}}%
+ \fi
+ \endgroup
+ \let#3=\pgfmathfloat@TMPB
+}%
+
+
+% Changes the current number pretty printer to #1.
+%
+% #1 is the macro base name for the pretty print routine, without the
+% leading '\'.
+\def\pgfmath@set@number@printer#1{%
+ \expandafter\let\expandafter\pgfmathprintnumber@\csname #1\endcsname
+ \expandafter\let\expandafter\pgfmathprintnumber@issci\csname #1@issci\endcsname
+}
+
+\pgfmath@set@number@printer{pgfmathprintnumber@STD}
+%\pgfmath@set@number@printer{pgfmathprintnumber@FIXED}
+%\pgfmath@set@number@printer{pgfmathprintnumber@FIXED@ZEROFILL}
+%\pgfmath@set@number@printer{pgfmathprintnumber@SCI@ZEROFILL}
+%\pgfmath@set@number@printer{pgfmathprintnumber@SCI}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% IMPL
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% equals only itsself when compared with \ifx:
+\def\pgfmathfloat@EOI{\pgfmathfloat@EOI}%
+
+% Re-use counters internally.
+%
+% They are always grouped and only used inside of the rounding
+% routines.
+\let\c@pgfmathroundto@prec=\pgfmathfloat@b@S% ATTENTION: DOUBLE-USED REGISTERS!
+\let\c@pgfmathroundto@offsetbehindperiod=\pgfmathfloat@b@E
+\newcount\c@pgfmathroundto@lastzeros
+
+\newif\ifpgfmathround@impl@PREPERIOD@is@negative@zero
+
+% PRECONDITION:
+% \ifpgfmathfloatroundhasperiod=\iftrue holds outside of the
+% current TeX group.
+%
+% POSTCONDITION:
+% \ifpgfmathfloatroundhasperiod will be set correctly AFTER the
+% current TeX group.
+% \ifpgfmathfloatroundmayneedrenormalize will be set globally
+\def\pgfmathroundto@impl#1{%
+ \global\pgfmathfloatroundmayneedrenormalizefalse
+ \pgfmathfloat@tmptoks={}%
+ \let\pgfmathround@next=\pgfutil@empty
+ \let\pgfmathround@cur=\pgfutil@empty
+ \let\pgfmathresult=\pgfutil@empty
+ \edef\pgfmathround@input{#1}%
+ \expandafter\c@pgfmathroundto@prec\pgfmathfloat@round@precision\relax
+ \c@pgfmathroundto@lastzeros=0
+ \c@pgfmathroundto@offsetbehindperiod=-1 % means: no period found so far
+ \pgfmathround@impl@PREPERIOD@is@negative@zerotrue
+ \expandafter\pgfmathroundto@impl@ITERATE@NODOT@firstcall\pgfmathround@input\pgfmathfloat@EOI
+}
+
+% \pgfmathroundto implementation in WORDS:
+%
+% coarse idea:
+% 1. collect all digits/sign BEFORE the first period in REVERSE order
+% 2. then, collect UP TO \prec digits after the period in REVERSE order
+% Steps 1. and 2. lead to the digit [sign] sequence
+% "x_{-p} x_{-p+1} ... x_{-2} x_{-1} '.' x_0 ... x_r"
+% where 'r' is the total number of digits. The integer 'p' denotes the
+% ACTUALLY collected number of digits behind the period.
+%
+% Let 'k' be the desired precision.
+%
+% Please note that pgfmathroundto rounds the mantisse, that means |abs(x)|.
+%
+% There are exactly TWO cases:
+% 1. The case with p<=k and x_{-p-1} = end of input.
+% 2. The case with p=k and x_{-p-1} is a further, next character.
+%
+% Then, for case 1.):
+% discard any unused zeros at the tail of our number (possibly
+% including the period)
+%
+% and in case 2.)
+% if NEXT DIGIT < 5:
+% do exactly the same as in case 1.) above and discard any
+% following digits.
+% else
+% let q := -p
+% while(x_q = 9 and q<=r )
+% if q>=0
+% set x_q = '0'
+% else
+% discard digit x_q='9'
+% fi
+% ++q
+% if q=0
+% discard the period
+% fi
+% end while
+% if q = r+1
+% insert a '1'
+% else
+% set x_q = x_q + 1
+% fi
+% fi
+%
+% All these loops have been implemented in spaghetti-code below.
+% Sorry, I fear its hard to understand. In principle, everything is
+% realised using more or less finite state machines (with some number
+% counting logic).
+%
+% Some comments:
+% - The token register \pgfmathfloat@tmptoks is used to accumulate the REVERSED input number.
+% - \pgfmathfloat@EOI always denotes 'END OF INPUT'.
+% - in the second stage, we need to reverse \pgfmathfloat@tmptoks.
+% This is -again- done with \pgfmathfloat@tmptoks.
+
+\def\pgfmathroundto@impl@discard@period#1.#2\pgfmathfloat@EOI{%
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \def\pgfmathresult{#1}%
+}
+
+\def\pgfmathroundto@impl@gobble@rest@and@start#1\pgfmathfloat@EOI{%
+ \pgfmathroundto@impl@start
+}
+\def\pgfmathroundto@impl@gobble@and@start\pgfmathfloat@EOI{%
+ \pgfmathroundto@impl@start
+}
+\def\pgfmathroundto@impl@gobble\pgfmathfloat@EOI{}%
+\def\pgfmathroundto@impl@gobble@rest#1\pgfmathfloat@EOI{}%
+
+% This method will be invoked as soon as the first step, the reverse
+% collection of up to PREC digits after the period, has finished.
+\def\pgfmathroundto@impl@start{%
+ \ifx\pgfmathround@next\pgfutil@empty
+ \ifnum\c@pgfmathroundto@offsetbehindperiod<0
+ % no period found.
+ \ifpgfmathfloat@fixed@digits@after@period
+ \ifnum\c@pgfmathroundto@prec=0\relax
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \edef\pgfmathresult{\pgfmathround@input}%
+ \else
+ \pgfmathfloat@tmptoks=\expandafter{\pgfmathround@input.}%
+ \c@pgfmathroundto@offsetbehindperiod=\c@pgfmathroundto@prec
+ \pgfmathroundto@impl@append@zeros
+ \edef\pgfmathresult{\the\pgfmathfloat@tmptoks}%
+ \fi
+ \else
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \edef\pgfmathresult{\pgfmathround@input}%
+ \fi
+ \else
+ %\ifnum\c@pgfmathroundto@offsetbehindperiod>\c@pgfmathroundto@prec
+ % \pgfmath@error{Internal logic error in pgfmathroundto at [I] - should not have happened!?}%
+ %\fi
+ \pgfmathroundto@impl@finish@with@truncation
+ \fi
+ \else
+ %\ifnum\c@pgfmathroundto@offsetbehindperiod=\c@pgfmathroundto@prec
+ %\else
+ % \pgfmath@error{Internal logic error in pgfmathroundto at [II] - should not have happened!? I have offsetbehindperiod=\the\c@pgfmathroundto@offsetbehindperiod and prec = \the\c@pgfmathroundto@prec}%
+ %\fi
+ \expandafter\ifnum\pgfmathround@next<5\relax
+ \pgfmathroundto@impl@finish@with@truncation
+ \else
+ \multiply\c@pgfmathroundto@offsetbehindperiod by-1
+ \expandafter\pgfmathroundto@impl@ADD@ONE\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \fi
+ \fi
+}
+
+% takes the current input and decides whether trailing zeros shall be
+% discarded or more zeros need to be filled in.
+\def\pgfmathroundto@impl@finish@with@truncation{%
+ \ifpgfmathfloat@fixed@digits@after@period
+ \expandafter\pgfmathroundto@impl@REVERSE\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \ifnum\c@pgfmathroundto@lastzeros=\c@pgfmathroundto@offsetbehindperiod
+ \ifpgfmathround@impl@PREPERIOD@is@negative@zero
+ % write '0.0000' instead of '-0.0000':
+ \expandafter\pgfmathroundto@impl@discard@minus\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \fi
+ \fi
+ \ifnum\c@pgfmathroundto@prec=0\relax
+ \expandafter\pgfmathroundto@impl@discard@period\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \else
+ \advance\c@pgfmathroundto@prec by-\c@pgfmathroundto@offsetbehindperiod
+ \c@pgfmathroundto@offsetbehindperiod=\c@pgfmathroundto@prec
+ \pgfmathroundto@impl@append@zeros
+ \edef\pgfmathresult{\the\pgfmathfloat@tmptoks}%
+ \fi
+ \else
+ \pgfmathroundto@impl@discard@suffix@zeros
+ \fi
+}
+
+\def\pgfmathroundto@impl@discard@minus-#1\pgfmathfloat@EOI{\pgfmathfloat@tmptoks={#1}}%
+
+% appends \c@pgfmathroundto@offsetbehindperiod zeros at the end of \pgfmathfloat@tmptoks.
+\def\pgfmathroundto@impl@append@zeros{%
+ \ifnum\c@pgfmathroundto@offsetbehindperiod>0
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \advance\c@pgfmathroundto@offsetbehindperiod by-1
+ \pgfmathroundto@impl@append@zeros
+ \fi
+}
+
+\def\pgfmathroundto@impl@ADD@ONE{%
+ \pgfmathfloat@tmptoks={}% no longer needed because its old value will be read from input
+ \pgfmathroundto@impl@ADD@ONE@ITERATE
+}
+\def\pgfmathroundto@impl@ADD@ONE@ITERATE{%
+ \pgfutil@ifnextchar\pgfmathfloat@EOI{%
+ \global\pgfmathfloatroundmayneedrenormalizetrue
+ \edef\pgfmathresult{1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@gobble
+ }{%
+ \pgfutil@ifnextchar.{%
+ \ifnum\c@pgfmathroundto@prec=0
+ % silently discard period in special case precision=0
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@ITERATE@gobble@dot}%
+ \else
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@NEXT@COLLECT}%
+ \fi
+ \pgfmathround@nextcmd
+ }{%
+ \pgfutil@ifnextchar+{%
+ \global\pgfmathfloatroundmayneedrenormalizetrue
+ \edef\pgfmathresult{1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@gobble@rest
+ }{%
+ \pgfutil@ifnextchar-{%
+ \global\pgfmathfloatroundmayneedrenormalizetrue
+ \edef\pgfmathresult{-1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@gobble@rest
+ }{%
+ \pgfmathroundto@impl@ADD@ONE@NEXT
+ }%
+ }%
+ }%
+ }%
+}
+
+\def\pgfmathroundto@impl@ADD@ONE@ITERATE@gobble@dot.{%
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \pgfmathroundto@impl@ADD@ONE@ITERATE
+}
+
+\def\pgfmathroundto@impl@ADD@ONE@NEXT@COLLECT#1{%
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@ADD@ONE@ITERATE
+}
+\def\pgfmathroundto@impl@ADD@ONE@NEXT#1{%
+ \ifnum#1=9
+ \ifnum\c@pgfmathroundto@offsetbehindperiod<0
+ \ifpgfmathfloat@fixed@digits@after@period
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter0\the\pgfmathfloat@tmptoks}%
+ \else
+ % silently DROP digit
+ \fi
+ \else
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter0\the\pgfmathfloat@tmptoks}%
+ \fi
+ \advance\c@pgfmathroundto@offsetbehindperiod by1
+ \ifnum\c@pgfmathroundto@offsetbehindperiod=0
+ \ifpgfmathfloat@fixed@digits@after@period
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@ITERATE}%
+ \else
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@ITERATE@gobble@dot}%
+ \fi
+ \else
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ADD@ONE@ITERATE}%
+ \fi
+ \else
+ % re-use this counter:
+ \c@pgfmathroundto@lastzeros=#1
+ \advance\c@pgfmathroundto@lastzeros by1
+ \edef\pgfmathresult{\the\c@pgfmathroundto@lastzeros\the\pgfmathfloat@tmptoks}%
+ \pgfmathfloat@tmptoks=\expandafter{\pgfmathresult}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@REVERSE@ITERATE}%
+ \fi
+ \pgfmathround@nextcmd
+}
+
+
+\def\pgfmathroundto@impl@discard@suffix@zeros{%
+ \ifnum\c@pgfmathroundto@lastzeros=\c@pgfmathroundto@offsetbehindperiod
+ \ifpgfmathround@impl@PREPERIOD@is@negative@zero
+ \pgfmathfloatroundhasperiodfalse
+ \aftergroup\pgfmathfloatroundhasperiodfalse
+ \def\pgfmathresult{0}% write '0' instead of '-0'
+ \else
+ \expandafter\pgfmathroundto@impl@discard@period\pgfmathround@input\pgfmathfloat@EOI
+ \fi
+ \else
+ \ifnum\c@pgfmathroundto@lastzeros=0
+ \expandafter\pgfmathroundto@impl@REVERSE\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \else
+ \expandafter\pgfmathroundto@impl@discard@suffix@zeros@ITERATE\the\pgfmathfloat@tmptoks\pgfmathfloat@EOI
+ \fi
+ \fi
+}
+
+% PRECONDITION:
+% \c@pgfmathroundto@lastzeros > 0
+\def\pgfmathroundto@impl@discard@suffix@zeros@ITERATE#1{%
+ \advance\c@pgfmathroundto@lastzeros by-1
+ \ifnum\c@pgfmathroundto@lastzeros=0
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@REVERSE}%
+ \else
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@discard@suffix@zeros@ITERATE}%
+ \fi
+ \pgfmathround@nextcmd
+}
+
+% Usage:
+% \pgfmathroundto@impl@REVERSE#1\pgfmathfloat@EOI
+% -> writes #1 reversed into \pgfmathfloat@tmptoks
+\def\pgfmathroundto@impl@REVERSE{%
+ \pgfmathfloat@tmptoks={}%
+ \pgfmathroundto@impl@REVERSE@ITERATE
+}
+
+\def\pgfmathroundto@impl@REVERSE@ITERATE{%
+ \pgfutil@ifnextchar\pgfmathfloat@EOI{%
+ \edef\pgfmathresult{\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@gobble
+ }{%
+ \pgfmathroundto@impl@REVERSE@NEXT
+ }%
+}
+
+\def\pgfmathroundto@impl@REVERSE@NEXT#1{%
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \pgfmathroundto@impl@REVERSE@ITERATE
+}
+
+\def\pgfmathroundto@impl@BEGIN@DOT.{%
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter.\the\pgfmathfloat@tmptoks}%
+ \c@pgfmathroundto@offsetbehindperiod=0
+ \pgfmathroundto@impl@ITERATE@DOT
+}
+\def\pgfmathroundto@impl@ITERATE@DOT{%
+ \pgfutil@ifnextchar\pgfmathfloat@EOI{%
+ % finished.
+ \pgfmathroundto@impl@gobble@and@start
+ }{%
+ \pgfmathroundto@impl@NEXT@DOT
+ }%
+}
+\def\pgfmathroundto@impl@NEXT@DOT#1{%
+ \ifnum\c@pgfmathroundto@offsetbehindperiod=\c@pgfmathroundto@prec
+ \def\pgfmathround@next{#1}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@gobble@rest@and@start}%
+ \else
+ \advance\c@pgfmathroundto@offsetbehindperiod by1
+ \ifnum#1=0
+ \advance\c@pgfmathroundto@lastzeros by1
+ \else
+ \c@pgfmathroundto@lastzeros=0
+ \fi
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ITERATE@DOT}%
+ \fi
+ \pgfmathround@nextcmd
+}%
+
+% in contrast to pgfmathroundto@impl@ITERATE@NODOT, this method here
+% checks also for signs
+\def\pgfmathroundto@impl@ITERATE@NODOT@firstcall#1{%
+ \def\pgfmathround@cur{#1}%
+ \ifx\pgfmathround@cur\pgfmathfloat@EOI
+ \pgfmathround@impl@PREPERIOD@is@negative@zerofalse
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@start}%
+ \else
+ \ifx\pgfmathround@cur\pgfmathfloatparsenumber@tok@PERIOD
+ \pgfmathround@impl@PREPERIOD@is@negative@zerofalse
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@BEGIN@DOT.}%
+ \else
+ \ifx\pgfmathround@cur\pgfmathfloatparsenumber@tok@MINUS
+ \else
+ \pgfmathround@impl@PREPERIOD@is@negative@zerofalse
+ \fi
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ITERATE@NODOT}%
+ \fi
+ \fi
+ \pgfmathround@nextcmd
+}
+
+\def\pgfmathroundto@impl@ITERATE@NODOT#1{%
+ \def\pgfmathround@cur{#1}%
+ \ifx\pgfmathround@cur\pgfmathfloat@EOI
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@start}%
+ \else
+ \ifx\pgfmathround@cur\pgfmathfloatparsenumber@tok@PERIOD
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@BEGIN@DOT.}%
+ \else
+ \ifx\pgfmathround@cur\pgfmathfloatparsenumber@tok@ZERO
+ \else
+ \pgfmathround@impl@PREPERIOD@is@negative@zerofalse
+ \fi
+ \pgfmathfloat@tmptoks=\expandafter{\expandafter#1\the\pgfmathfloat@tmptoks}%
+ \def\pgfmathround@nextcmd{\pgfmathroundto@impl@ITERATE@NODOT}%
+ \fi
+ \fi
+ \pgfmathround@nextcmd
+}
+
+%--------------------------------------------
+% END of pgfmathroundto implementation.
+%--------------------------------------------
+
+
+% flags, mantisse and exponent has already been stored into
+% \pgfmathfloat@a@* [using ...@Mtok]
+%
+% PRECONDITION:
+% \ifpgfmathfloatroundhasperiod = \iftrue outside of the current
+% group
+%
+% POSTCONDITION:
+% \ifpgfmathfloatroundhasperiod will be set after the current TeX
+% group.
+\def\pgfmathfloatround@impl{%
+ \expandafter\pgfmathroundto@impl\expandafter{\the\pgfmathfloat@a@Mtok}%
+ \ifpgfmathfloatroundmayneedrenormalize
+ \ifpgfmathfloatroundhasperiod
+ \expandafter\pgfmathfloatround@impl@renormalize\pgfmathresult\pgfmathfloat@EOI%
+ \else
+ \expandafter\pgfmathfloatround@impl@renormalize\pgfmathresult.\pgfmathfloat@EOI%
+ \fi
+ \advance\pgfmathfloat@a@E by1
+ \fi
+ \edef\pgfmathresult{\the\pgfmathfloat@a@S\pgfmathresult e\the\pgfmathfloat@a@E}%
+}
+
+\def\pgfmathfloatround@impl@renormalize#1#2.#3\pgfmathfloat@EOI{%
+ \pgfmathroundto@impl{#1.#2#3}%
+}
+
+
+
+
+
+% ATTENTION: this thing REQUIRES a period in the mantisse!
+% collects everything into \pgfmathresult
+\def\pgfmathfloattofixed@impl#1.#2\relax{%
+ \ifnum\pgfmathfloat@a@E<0
+ \pgfmathfloat@a@Mtok={0.}%
+ \loop
+ \ifnum\pgfmathfloat@a@E<-1
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok 0}%
+ \advance\pgfmathfloat@a@E by1
+ \repeat
+ \def\pgfmathfloat@TMPB{#2}%
+ \def\pgfmathfloat@TMPC{0}%
+ \ifx\pgfmathfloat@TMPB\pgfmathfloat@TMPC
+ \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok #1}%
+ \else
+ \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok #1#2}%
+ \fi
+ \else
+ \ifnum\pgfmathfloat@a@E=0%
+ \edef\pgfmathresult{#1.#2}%
+ \else
+ \pgfmathfloat@a@Mtok={#1}%
+ \pgfmathfloattofixed@impl@collectmantisse#2\count\pgfmathfloat@a@E
+ \edef\pgfmathresult{\the\pgfmathfloat@a@Mtok}%
+ \fi
+ \fi
+}
+
+\def\pgfmathfloattofixed@impl@collectmantisse#1#2\count#3{%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok #1}%
+ \advance\pgfmathfloat@a@E by-1%
+ \def\pgfmathfloat@TMPB{#2}%
+ \ifx\pgfmathfloat@TMPB\pgfutil@empty
+ \loop
+ \ifnum\pgfmathfloat@a@E>0%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok 0}%
+ \advance\pgfmathfloat@a@E by-1%
+ \repeat
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok .0}%
+ \else
+ \ifnum\pgfmathfloat@a@E=0
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok .#2}%
+ \else
+ \pgfmathfloattofixed@impl@collectmantisse#2\count#3%
+ \fi
+ \fi
+}
+
+
+% ============================================
+%
+%
+% \pgfmathfloatparsenumber implementation
+%
+%
+% ============================================
+
+
+% accepted parser tokens:
+\def\pgfmathfloatparsenumber@tok@ONE{1}
+\def\pgfmathfloatparsenumber@tok@TWO{2}
+\def\pgfmathfloatparsenumber@tok@THREE{3}
+\def\pgfmathfloatparsenumber@tok@FOUR{4}
+\def\pgfmathfloatparsenumber@tok@FIVE{5}
+\def\pgfmathfloatparsenumber@tok@SIX{6}
+\def\pgfmathfloatparsenumber@tok@SEVEN{7}
+\def\pgfmathfloatparsenumber@tok@EIGHT{8}
+\def\pgfmathfloatparsenumber@tok@NINE{9}
+\def\pgfmathfloatparsenumber@tok@ZERO{0}
+\def\pgfmathfloatparsenumber@tok@e{e}
+\def\pgfmathfloatparsenumber@tok@E{E}
+\def\pgfmathfloatparsenumber@tok@PLUS{+}
+\def\pgfmathfloatparsenumber@tok@MINUS{-}
+\def\pgfmathfloatparsenumber@tok@n{n}
+\def\pgfmathfloatparsenumber@tok@N{N}
+\def\pgfmathfloatparsenumber@tok@i{i}
+\def\pgfmathfloatparsenumber@tok@I{I}
+\def\pgfmathfloatparsenumber@tok@PERIOD{.}
+
+\newif\ifpgfmathfloatparsenumberpendingperiod
+
+% Starts a finite-start-machine parser to read a number.
+%
+% It assigns \pgfmathfloat@a@S, \pgfmathfloat@a@Mtok, \pgfmathfloat@a@E.
+\def\pgfmathfloatparsenumber@impl#1{%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \pgfmathfloat@tmptoks={}% this register is used to collect PENDING ZEROS
+ \pgfmathfloat@a@E=0
+ % start parsing: check for sign:
+ \def\pgfmathfloatparsenumber@curtok{#1}%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@PLUS
+ \pgfmathfloat@a@S=1\relax%
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@init}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@MINUS
+ \pgfmathfloat@a@S=2\relax%
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@init}%
+ \else
+ \pgfmathfloat@a@S=1\relax%
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@init#1}%
+ \fi
+ \fi
+ \pgfmathfloatparsenumber@NEXT
+}
+
+\def\pgfmathfloatparsenumber@sanitize@digit{%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@ONE
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@TWO
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@THREE
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@FOUR
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@FIVE
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@SIX
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@SEVEN
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@EIGHT
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@NINE
+ \else
+ \def\pgfmathfloatparsenumber@NEXT{\expandafter\pgfmathfloatparsenumber@impl@error\pgfmathfloatparsenumber@curtok}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+
+% FROM: checksign.
+%
+\def\pgfmathfloatparsenumber@impl@init#1{%
+ \def\pgfmathfloatparsenumber@curtok{#1}%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@n
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readnan}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@i
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readinf}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@ZERO
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@leadingzero}%
+ \else
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@Mtok={#1}%
+ \pgfmathfloatparsenumberpendingperiodtrue
+ \pgfmathfloatparsenumber@impl@positiveexp}%
+ \pgfmathfloatparsenumber@sanitize@digit
+ \fi
+ \fi
+ \fi
+ \pgfmathfloatparsenumber@NEXT
+}
+
+\def\pgfmathfloatparsenumber@impl@error#1\pgfmathfloat@EOI{%
+ \begingroup
+ \pgfmathfloat@a@Mtok={#1}%
+ \pgfmath@error{Could not read input number, sorry. The unreadable part was near '\the\pgfmathfloat@a@Mtok'.}%
+ \endgroup
+}%
+
+\def\pgfmathfloatparsenumber@impl@finish#1\pgfmathfloat@EOI{}
+
+\def\pgfmathfloatparsenumber@impl@readnan an{%
+ \pgfmathfloat@a@S=3\relax%
+ \pgfmathfloat@a@Mtok={nan}%
+ \pgfmathfloat@a@E=0%
+ \pgfmathfloatparsenumber@impl@finish
+}
+\def\pgfmathfloatparsenumber@impl@readinf nf{%
+ \ifnum\pgfmathfloat@a@S=1
+ \pgfmathfloat@a@S=4\relax%
+ \pgfmathfloat@a@Mtok={inf}%
+ \else
+ \pgfmathfloat@a@S=5\relax%
+ \pgfmathfloat@a@Mtok={-inf}%
+ \fi
+ \pgfmathfloat@a@E=0%
+ \pgfmathfloatparsenumber@impl@finish
+}
+\def\pgfmathfloatparsenumber@impl@leadingzero#1{%
+ \def\pgfmathfloatparsenumber@curtok{#1}%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@ZERO
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloatparsenumber@impl@leadingzero}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@PERIOD
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@E=-1
+ \pgfmathfloatparsenumber@impl@leadingzero@foundperiod}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@e
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ \pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@E
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ \pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloat@EOI
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ }%
+ \else
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@Mtok={#1}%
+ \pgfmathfloatparsenumberpendingperiodtrue
+ \pgfmathfloatparsenumber@impl@positiveexp}%
+ \pgfmathfloatparsenumber@sanitize@digit
+ \fi\fi\fi
+ \fi
+ \fi
+ \pgfmathfloatparsenumber@NEXT
+}
+
+\def\pgfmathfloatparsenumber@impl@leadingzero@foundperiod#1{%
+ \def\pgfmathfloatparsenumber@curtok{#1}%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@ZERO
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \advance\pgfmathfloat@a@E by-1
+ \pgfmathfloatparsenumber@impl@leadingzero@foundperiod}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@e
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ \pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@E
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ \pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloat@EOI
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@S=0\relax%
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0%
+ }%
+ \else
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@a@Mtok={#1}%
+ \pgfmathfloatparsenumberpendingperiodtrue
+ \pgfmathfloatparsenumber@impl@finish@number@after@period}%
+ \pgfmathfloatparsenumber@sanitize@digit
+ \fi\fi\fi
+ \fi
+ \pgfmathfloatparsenumber@NEXT
+}
+
+
+\def\pgfmathfloatparsenumber@impl@positiveexp#1{%
+ \def\pgfmathfloatparsenumber@curtok{#1}%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@ZERO
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \advance\pgfmathfloat@a@E by1
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \pgfmathfloatparsenumber@impl@pendingzeros@positiveexp}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@PERIOD
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@finish@number@after@period}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@e
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@E
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloat@EOI
+ \def\pgfmathfloatparsenumber@NEXT{}%
+ \else
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \advance\pgfmathfloat@a@E by1
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.}%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \fi
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \pgfmathfloatparsenumber@impl@positiveexp}%
+ \pgfmathfloatparsenumber@sanitize@digit
+ \fi\fi\fi
+ \fi
+ \fi
+ \pgfmathfloatparsenumber@NEXT
+}
+
+\def\pgfmathfloatparsenumber@impl@readexponent#1\pgfmathfloat@EOI{%
+ \advance\pgfmathfloat@a@E by#1\relax
+}
+
+\def\pgfmathfloatparsenumber@impl@pendingzeros@positiveexp#1{%
+ \def\pgfmathfloatparsenumber@curtok{#1}%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@ZERO
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \advance\pgfmathfloat@a@E by1
+ \pgfmathfloatparsenumber@impl@pendingzeros@positiveexp}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@PERIOD
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@finish@number@after@period}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@e
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@E
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloat@EOI
+ \def\pgfmathfloatparsenumber@NEXT{}%
+ \else
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \advance\pgfmathfloat@a@E by1
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.}%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \fi
+ \pgfmathfloat@a@Mtok=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfmathfloat@a@Mtok\the\pgfmathfloat@tmptoks}%
+ \pgfmathfloat@tmptoks={}%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \pgfmathfloatparsenumber@impl@positiveexp}%
+ \pgfmathfloatparsenumber@sanitize@digit
+ \fi\fi\fi
+ \fi
+ \fi
+ \pgfmathfloatparsenumber@NEXT
+}
+
+\def\pgfmathfloatparsenumber@impl@finish@number@after@period#1{%
+ \def\pgfmathfloatparsenumber@curtok{#1}%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@ZERO
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \pgfmathfloatparsenumber@impl@pendingzeros}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@e
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@E
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloat@EOI
+ \def\pgfmathfloatparsenumber@NEXT{}%
+ \else
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.}%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \fi
+ \pgfmathfloat@a@Mtok=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfmathfloat@a@Mtok\the\pgfmathfloat@tmptoks}%
+ \pgfmathfloat@tmptoks={}%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \pgfmathfloatparsenumber@impl@finish@number@after@period}%
+ \pgfmathfloatparsenumber@sanitize@digit
+ \fi\fi\fi
+ \fi
+ \pgfmathfloatparsenumber@NEXT
+}
+
+\def\pgfmathfloatparsenumber@impl@pendingzeros#1{%
+ \def\pgfmathfloatparsenumber@curtok{#1}%
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@ZERO
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \pgfmathfloat@tmptoks=\expandafter{\the\pgfmathfloat@tmptoks0}%
+ \pgfmathfloatparsenumber@impl@pendingzeros}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@e
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloatparsenumber@tok@E
+ \def\pgfmathfloatparsenumber@NEXT{\pgfmathfloatparsenumber@impl@readexponent}%
+ \else
+ \ifx\pgfmathfloatparsenumber@curtok\pgfmathfloat@EOI
+ \def\pgfmathfloatparsenumber@NEXT{}%
+ \else
+ \def\pgfmathfloatparsenumber@NEXT{%
+ \ifpgfmathfloatparsenumberpendingperiod
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok.}%
+ \pgfmathfloatparsenumberpendingperiodfalse
+ \fi
+ \pgfmathfloat@a@Mtok=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfmathfloat@a@Mtok\the\pgfmathfloat@tmptoks}%
+ \pgfmathfloat@tmptoks={}%
+ \pgfmathfloat@a@Mtok=\expandafter{\the\pgfmathfloat@a@Mtok#1}%
+ \pgfmathfloatparsenumber@impl@finish@number@after@period}%
+ \pgfmathfloatparsenumber@sanitize@digit
+ \fi\fi\fi
+ \fi
+ \pgfmathfloatparsenumber@NEXT
+}
+
+
+
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots/pgfplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/pgfplots.code.tex
new file mode 100644
index 00000000000..ed8e8e611ec
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/pgfplots.code.tex
@@ -0,0 +1,5918 @@
+%--------------------------------------------
+%
+% Package pgfplots
+%
+% Provides a user-friendly interface to create function plots (normal
+% plots, semi-logplots and double-logplots).
+%
+% It is based on Till Tantau's PGF package.
+%
+% Copyright 2007/2008 by Christian Feuersänger.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%--------------------------------------------
+
+\input pgfplotsliststructure.code.tex
+\input pgfplotsarray.code.tex
+\input pgfplotstable.code.tex
+\input pgfplotsoldpgfsupp_loader.code.tex
+\input pgfplots.stackedplots.code.tex
+
+\usetikzlibrary{decorations,decorations.pathmorphing,decorations.pathreplacing}
+
+% FIXME: reduce number of variables!
+\newtoks\pgfplots@toka
+
+\newcount\pgfplots@ticknum
+\newif\ifpgfplots@xislinear
+\newif\ifpgfplots@yislinear
+\newcount\pgfplots@numplots
+\newdimen\pgfplots@xcoordminTEX
+\newdimen\pgfplots@xcoordmaxTEX
+\newdimen\pgfplots@ycoordminTEX
+\newdimen\pgfplots@ycoordmaxTEX
+\newdimen\pgfplots@tmpa
+\newdimen\pgfplots@tmpb
+\newif\ifpgfplots@warn@for@filter@discards
+\newif\ifpgfplots@isuniformtick
+\newif\ifpgfplots@addplot@table@from@macro
+\newif\ifpgfplots@clip@limits
+\newif\ifpgfplots@enlargelimits
+\newif\ifpgfplots@enlargelimits@rel@thresh
+\newif\ifpgfplots@enlargelimits@auto
+\newif\ifpgfplots@tickshow
+\newif\ifpgfplots@xminorticks
+\newif\ifpgfplots@xmajorticks
+\newif\ifpgfplots@yminorticks
+\newif\ifpgfplots@ymajorticks
+\newif\ifpgfplots@xminorgrids
+\newif\ifpgfplots@xmajorgrids
+\newif\ifpgfplots@yminorgrids
+\newif\ifpgfplots@ymajorgrids
+\newif\ifpgfplots@scaled@ticks
+\newif\ifpgfplots@identify@log@minor@tick@pos
+\newif\ifpgfplots@disablelogfilter
+\newif\ifpgfplots@disabledatascaling
+\newif\ifpgfplots@hide
+\newif\ifpgfplots@is@old@list@format
+\newif\ifpgfplots@errorbars@enabled
+\newif\ifpgfplots@scale@only@axis
+\newif\ifpgfplots@xticklabel@interval
+\newif\ifpgfplots@yticklabel@interval
+\newif\ifpgfplots@stacked@x
+\newif\ifpgfplots@stackedmode
+\newif\ifpgfplots@stacked@reverse
+\newif\ifpgfplots@stacked@plus
+\let\pgfplots@TMP=\pgfutil@empty
+\let\pgfplots@TMPB=\pgfutil@empty
+\let\pgfplots@TMPC=\pgfutil@empty
+\let\pgfnodepartimagebox=\pgfnodeparttextbox
+
+\newif\ifpgfplots@collect@firstplot@astick
+
+\def\pgfplots@errorbars@xdirection{0}% pre-init, see below
+\def\pgfplots@errorbars@ydirection{0}%
+
+\def\pgfplots@error#1{\PackageError{pgfplots}{#1}{}}%
+\def\pgfplots@warning#1{\pgfplots@message{#1}}%
+\def\pgfplots@message#1{%
+ \immediate\write16{#1}%
+}%
+
+\def\pgfplots@leftover{}
+\def\pgfplots@rightover{}
+\def\axisdefaultwidth{240pt}
+\def\axisdefaultheight{207pt}
+
+
+% Assigns list contents #2 to a list macro #1.
+%
+% The list contents may be provided in one of two formats:
+% a) in the (deprecated) list format 'first\\second\\thirst\\'
+% or
+% b) in the PGF foreach list format 'first,second,third'.
+\def\pgfplots@assign@list#1#2{%
+ \def\pgfplots@TMP{#2}%
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \pgfplotslistnewempty#1%
+ \else
+ \pgfplots@check@backwards@compatible@list@format #2\\\pgfplots@EOI
+ \ifpgfplots@is@old@list@format
+ \pgfplotslistnew#1{#2}%
+ \else
+ \pgfplots@foreach@to@list{#2}\to#1
+ \fi
+ \fi
+}%
+
+\def\pgfplots@EOI{\pgfplots@EOI}%
+
+% Sets the boolean \ifpgfplots@is@old@list@format to true if and only
+% if the input is a list in the format '{first\\second\\}'.
+%
+% This format is deprecated, but is still provided for backwards
+% compatibility.
+%
+% Usage:
+% \pgfplots@check@backwards@compatible@list@format <argument>'\\'\pgfplots@EOI
+% you NEED to append '\\\pgfplots@EOI' at the end.
+\def\pgfplots@check@backwards@compatible@list@format#1\\#2\pgfplots@EOI{%
+ \def\pgfplots@TMP{#2}%
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \pgfplots@is@old@list@formatfalse
+ \else
+ \pgfplots@is@old@list@formattrue
+ \fi
+}%
+
+
+
+% Creates a named plot cycle list.
+%
+% #1: the name of the final list. Can be used in 'cycle list name'
+% #2: the list entries. You can use either a comma-separated list or
+% a '\\'-terminated list. The latter case also requires '\\'
+% AFTER the last entry.
+\def\pgfcreateplotcyclelist#1#2{\pgfplots@assign@list#1{#2}}
+
+\pgfcreateplotcyclelist{\blackwhiteplotspeclist}{%
+ mark options={fill=gray},mark=*\\%
+ mark options={fill=gray},mark=square*\\%
+ mark options={fill=gray},mark=otimes*\\%
+ mark=star\\%
+ mark options={fill=gray},mark=diamond*\\%
+ densely dashed,mark options={solid,fill=gray},mark=*\\%
+ densely dashed,mark options={solid,fill=gray},mark=square*\\%
+ densely dashed,mark options={solid,fill=gray},mark=otimes*\\%
+ densely dashed,mark options={solid},mark=star\\%
+ densely dashed,mark options={solid,fill=gray},mark=diamond*\\%
+}
+\pgfcreateplotcyclelist{\coloredplotspeclist}{%
+ blue,mark options={fill=blue!80!black},mark=*\\%
+ red,mark options={fill=red!80!black},mark=square*\\%
+ brown!60!black,mark options={fill=brown!80!black},mark=otimes*\\%
+ black,mark=star\\%
+ blue,mark options={fill=blue!80!black},mark=diamond*\\%
+ red,densely dashed,mark options={solid,fill=red!80!black},mark=*\\%
+ brown!60!black,densely dashed,mark options={solid,fill=brown!80!black},mark=square*\\%
+ black,densely dashed,mark options={solid,fill=gray},mark=otimes*\\%
+ blue,densely dashed,mark=star,mark options=solid\\%
+ red,densely dashed,mark options={solid,fill=red!80!black},mark=diamond*\\%
+}
+
+\def\pgfplotsset{\pgfqkeys{/pgfplots}}
+
+\def\pgfplotsdeprecatedstylecheck#1{%
+ \pgfkeysifdefined{#1/.@cmd}{%
+ \begingroup
+ \edef\pgfkeyscurrentkey{#1}%
+ \pgfkeyssplitpath
+ \pgfplots@warning{Warning: Loading deprecated style option
+ \pgfkeyscurrentpath/\pgfkeyscurrentname.
+ Please replace '\string\tikzstyle{\pgfkeyscurrentname}'
+ with '\string\pgfplotsset{\pgfkeyscurrentname/.style={}}'
+ (or '\string\pgfplotsset{\pgfkeyscurrentname/.append style={}}').}%
+ \endgroup
+ \pgfkeysvalueof{#1/.@cmd}\pgfeov
+ }{}%
+}%
+
+\pgfkeys{%
+ /pgfplots/search path for tikz/.unknown/.code={%
+ \let\searchname=\pgfkeyscurrentname%
+ \pgfkeysalso{%
+ /tikz/\searchname/.try=#1,
+ /pgfplots/\searchname/.lastretry=#1
+ }%
+ },%
+ /pgfplots/.is family,
+ /pgfplots/scale/.is family,
+ /pgfplots/legend/.is family,
+ /pgfplots/tick/.is family,
+ /pgfplots/axis/.is family,
+ /pgfplots/descriptions/.is family,
+ /pgfplots/style commands/.is family,
+ /pgfplots/naming commands/.is family,
+ /pgfplots/error bars/.is family,
+ /pgfplots/every axis/.style={},
+ /pgfplots/every axis/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis}},
+ /pgfplots/every axis/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every semilogx axis/.style={},
+ /pgfplots/every semilogx axis/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every semilogx axis}},
+ /pgfplots/every semilogx axis/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every semilogy axis/.style={},
+ /pgfplots/every semilogy axis/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every semilogy axis}},
+ /pgfplots/every semilogy axis/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every loglog axis/.style={},
+ /pgfplots/every loglog axis/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every loglog axis}},
+ /pgfplots/every loglog axis/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every linear axis/.style={},
+ /pgfplots/every linear axis/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every linear axis}},
+ /pgfplots/every linear axis/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis plot/.style={},
+ /pgfplots/every axis plot/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis plot}},
+ /pgfplots/every axis plot/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis plot post/.style={},
+ /pgfplots/every axis plot post/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis plot}},
+ /pgfplots/every axis label/.style={},
+ /pgfplots/every axis label/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis label}},
+ /pgfplots/every axis label/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis x label/.style={at={(0.5,0)},below,yshift=-15pt},
+ /pgfplots/every axis x label/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis x label}},
+ /pgfplots/every axis x label/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis y label/.style={at={(0,0.5)},xshift=-35pt,rotate=90},
+ /pgfplots/every axis y label/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis y label}},
+ /pgfplots/every axis y label/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis title/.style={at={(0.5,1)},above,yshift=6pt},
+ /pgfplots/every axis title/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis title}},
+ /pgfplots/every axis title/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every tick/.style={very thin,gray},
+ /pgfplots/every tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every tick}},
+ /pgfplots/every tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every minor tick/.style={},
+ /pgfplots/every minor tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every minor tick}},
+ /pgfplots/every minor tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every major tick/.style={},
+ /pgfplots/every major tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every major tick}},
+ /pgfplots/every major tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every x tick/.style={},
+ /pgfplots/every x tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every x tick}},
+ /pgfplots/every x tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every minor x tick/.style={},
+ /pgfplots/every minor x tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every minor x tick}},
+ /pgfplots/every minor x tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every major x tick/.style={},
+ /pgfplots/every major x tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every major x tick}},
+ /pgfplots/every major x tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every y tick/.style={},
+ /pgfplots/every y tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every y tick}},
+ /pgfplots/every y tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every minor y tick/.style={},
+ /pgfplots/every minor y tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every minor y tick}},
+ /pgfplots/every minor y tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every major y tick/.style={},
+ /pgfplots/every major y tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every major y tick}},
+ /pgfplots/every major y tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis grid/.style={help lines},
+ /pgfplots/every axis grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis grid}},
+ /pgfplots/every axis grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every minor grid/.style={},
+ /pgfplots/every minor grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every minor grid}},
+ /pgfplots/every minor grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every major grid/.style={},
+ /pgfplots/every major grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every major grid}},
+ /pgfplots/every major grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis x grid/.style={},
+ /pgfplots/every axis x grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis x grid}},
+ /pgfplots/every axis x grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every minor x grid/.style={},
+ /pgfplots/every minor x grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every minor x grid}},
+ /pgfplots/every minor x grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every major x grid/.style={},
+ /pgfplots/every major x grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every major x grid}},
+ /pgfplots/every major x grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis y grid/.style={},
+ /pgfplots/every axis y grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis y grid}},
+ /pgfplots/every axis y grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every minor y grid/.style={},
+ /pgfplots/every minor y grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every minor y grid}},
+ /pgfplots/every minor y grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every major y grid/.style={},
+ /pgfplots/every major y grid/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every major y grid}},
+ /pgfplots/every major y grid/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every tick label/.style={},
+ /pgfplots/every tick label/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every tick label}},
+ /pgfplots/every tick label/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every x tick label/.style={},
+ /pgfplots/every x tick label/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every x tick label}},
+ /pgfplots/every x tick label/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every extra x tick/.style={},
+ /pgfplots/every extra x tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every extra x tick}},
+ /pgfplots/every extra x tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/extra x tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/extra x tick style/.code={%
+ \pgfkeysalso{/pgfplots/every extra x tick/.append style={#1}}%
+ },
+ /pgfplots/every x tick scale label/.style={at={(1,0)},yshift=-2em,left,inner sep=0pt},
+ /pgfplots/every x tick scale label/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every x tick scale label}},
+ /pgfplots/every x tick scale label/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every y tick label/.style={},
+ /pgfplots/every y tick label/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every y tick label}},
+ /pgfplots/every y tick label/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every extra y tick/.style={},
+ /pgfplots/every extra y tick/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every extra y tick}},
+ /pgfplots/every extra y tick/.belongs to family=/pgfplots/style commands,
+ /pgfplots/extra y tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/extra y tick style/.code={%
+ \pgfkeysalso{/pgfplots/every extra y tick/.append style={#1}}%
+ },
+ /pgfplots/every y tick scale label/.style={at={(0,1)},above right,inner sep=0pt,yshift=0.3em},
+ /pgfplots/every y tick scale label/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every y tick scale label}},
+ /pgfplots/every y tick scale label/.belongs to family=/pgfplots/style commands,
+ /pgfplots/every axis legend/.style={%
+ cells={anchor=center},
+ inner xsep=3pt,inner ysep=2pt,nodes={inner sep=2pt,text depth=0.15em},
+ anchor=north east,%
+ shape=rectangle,%
+ fill=white,%
+ draw=black,
+ at={(0.98,0.98)},
+ },
+ /pgfplots/every axis legend/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis legend}},
+ /pgfplots/every axis legend/.belongs to family=/pgfplots/style commands,
+% tick options:
+ /pgfplots/xticklabel/.store in= \pgfplots@xticklabel,
+ /pgfplots/xticklabel/.belongs to family=/pgfplots/tick,
+ /pgfplots/xticklabel=,
+ /pgfplots/xticklabels/.belongs to family=/pgfplots/tick,
+ /pgfplots/xticklabels/.code={%
+ \pgfplots@foreach@to@list{#1}\to\pgfplots@xticklabels
+ \let\pgfplots@xticklabel=\pgfplots@user@ticklabel@list@x
+ },
+ /pgfplots/yticklabels/.belongs to family=/pgfplots/tick,
+ /pgfplots/yticklabels/.code={%
+ \pgfplots@foreach@to@list{#1}\to\pgfplots@yticklabels
+ \let\pgfplots@yticklabel=\pgfplots@user@ticklabel@list@y
+ },
+ /pgfplots/yticklabel/.store in= \pgfplots@yticklabel,
+ /pgfplots/yticklabel/.belongs to family=/pgfplots/tick,
+ /pgfplots/yticklabel=,
+ /pgfplots/x tick label as interval/.is if=pgfplots@xticklabel@interval,
+ /pgfplots/x tick label as interval/.default=true,
+ /pgfplots/x tick label as interval/.belongs to family=/pgfplots/tick,
+ /pgfplots/y tick label as interval/.is if=pgfplots@yticklabel@interval,
+ /pgfplots/y tick label as interval/.default=true,
+ /pgfplots/y tick label as interval/.belongs to family=/pgfplots/tick,
+ /pgfplots/extra x tick label/.store in= \pgfplots@extra@xticklabel,
+ /pgfplots/extra x tick label/.belongs to family=/pgfplots/tick,
+ /pgfplots/extra x tick label=,
+ /pgfplots/extra x tick labels/.belongs to family=/pgfplots/tick,
+ /pgfplots/extra x tick labels/.code={%
+ \pgfplots@foreach@to@list{#1}\to\pgfplots@extra@xticklabels
+ \let\pgfplots@extra@xticklabel=\pgfplots@user@extra@ticklabel@list@x
+ },
+ /pgfplots/extra y tick labels/.code={%
+ \pgfplots@foreach@to@list{#1}\to\pgfplots@extra@yticklabels
+ \let\pgfplots@extra@yticklabel=\pgfplots@user@extra@ticklabel@list@y
+ },
+ /pgfplots/xtick/.store in= \pgfplots@xtick,
+ /pgfplots/xtick/.belongs to family=/pgfplots/tick,
+ /pgfplots/xtick=,
+ /pgfplots/extra x ticks/.store in=\pgfplots@extra@xtick,
+ /pgfplots/extra x ticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/extra x ticks=,
+ /pgfplots/xtickten/.store in= \pgfplots@xtickten,
+ /pgfplots/xtickten/.belongs to family=/pgfplots/tick,
+ /pgfplots/xtickten=,
+ /pgfplots/extra y tick label/.store in= \pgfplots@extra@yticklabel,
+ /pgfplots/extra y tick label/.belongs to family=/pgfplots/tick,
+ /pgfplots/extra y tick label=,
+ /pgfplots/ytick/.store in= \pgfplots@ytick,
+ /pgfplots/ytick/.belongs to family=/pgfplots/tick,
+ /pgfplots/ytick=,
+ /pgfplots/extra y ticks/.store in=\pgfplots@extra@ytick,
+ /pgfplots/extra y ticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/extra y ticks=,
+ /pgfplots/ytickten/.store in= \pgfplots@ytickten,
+ /pgfplots/ytickten/.belongs to family=/pgfplots/tick,
+ /pgfplots/ytickten=,
+ /pgfplots/tick scale label code/.code={$\cdot 10^{#1}$},
+ /pgfplots/tick scale label code/.belongs to family=/pgfplots/tick,
+ /pgfplots/scaled ticks/.is if=pgfplots@scaled@ticks,
+ /pgfplots/scaled ticks/.default=false,
+ /pgfplots/scaled ticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/scaled ticks=true,
+ /pgfplots/scale ticks above exponent/.store in= \pgfplots@scale@ticks@above@exponent,
+ /pgfplots/scale ticks above exponent/.belongs to family=/pgfplots/tick,
+ /pgfplots/scale ticks above exponent=3,
+ /pgfplots/scale ticks below exponent/.store in= \pgfplots@scale@ticks@below@exponent,
+ /pgfplots/scale ticks below exponent/.belongs to family=/pgfplots/tick,
+ /pgfplots/scale ticks below exponent=-1,
+ /pgfplots/subtickwidth/.store in= \pgfplots@subtickwidth,
+ /pgfplots/subtickwidth/.belongs to family=/pgfplots/tick,
+ /pgfplots/subtickwidth=0.1cm,
+ /pgfplots/tickwidth/.store in= \pgfplots@tickwidth,
+ /pgfplots/tickwidth/.belongs to family=/pgfplots/tick,
+ /pgfplots/tickwidth=0.15cm,
+ /pgfplots/minor x tick num/.initial=0,
+ /pgfplots/minor x tick num/.belongs to family=/pgfplots/tick,
+ /pgfplots/minor y tick num/.initial=0,
+ /pgfplots/minor y tick num/.belongs to family=/pgfplots/tick,
+ /pgfplots/minor tick num/.style={/pgfplots/minor x tick num=#1,/pgfplots/minor y tick num=#1},
+ /pgfplots/minor tick num/.belongs to family=/pgfplots/tick,
+ /pgfplots/minor tick length/.estore in=\pgfplots@subtickwidth,
+ /pgfplots/minor tick length/.belongs to family=/pgfplots/tick,
+ /pgfplots/major tick length/.estore in=\pgfplots@tickwidth,
+ /pgfplots/major tick length/.belongs to family=/pgfplots/tick,
+ /pgfplots/max space between ticks/.estore in=\axisdefaulttickwidth,
+ /pgfplots/max space between ticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/max space between ticks=35,% the maximum space between adjacent ticks (in pt, but don't specify the unit 'pt')
+ /pgfplots/try min ticks/.estore in= \axisdefaulttryminticks,
+ /pgfplots/try min ticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/try min ticks=4,
+ /pgfplots/try min ticks log/.estore in= \pgfplots@default@try@minticks@log,
+ /pgfplots/try min ticks log/.belongs to family=/pgfplots/tick,
+ /pgfplots/try min ticks log=3,
+ /pgfplots/log plot exponent style/.style={/pgf/number format/fixed,/pgf/number format/precision=2},
+ /pgfplots/log plot exponent style/.belongs to family=/pgfplots/tick,
+ /pgfplots/log identify minor tick positions/.is if=pgfplots@identify@log@minor@tick@pos,
+ /pgfplots/log identify minor tick positions/.belongs to family=/pgfplots/tick,
+ /pgfplots/log identify minor tick positions=true,
+ /pgfplots/log number format code/.code={{%
+ \pgfmathlogtologten@{#1}%
+ \ifpgfplots@identify@log@minor@tick@pos
+ \expandafter\pgfplots@is@log@tick@a@minor@tick@pos\pgfmathresult\relax%
+ \else
+ \pgfplots@log@tick@isminor@tick@posfalse
+ \fi
+ \ifpgfplots@log@tick@isminor@tick@pos
+ \pgfmathprintnumber[sci]{\pgfmathresult}%
+ \else
+ \pgfkeysalso{/pgfplots/log plot exponent style,/pgfplots/log base 10 number format code=\pgfmathresult}%
+ \fi
+ }},
+ /pgfplots/log number format code/.belongs to family=/pgfplots/tick,
+ /pgfplots/log base 10 number format code/.code={$10^{\pgfmathprintnumber{#1}}$},
+ /pgfplots/log base 10 number format code/.belongs to family=/pgfplots/tick,
+% sets \pgfplots@tickposnum to
+% left=0
+% right=1
+% both=2
+ /pgfplots/tickpos/.is choice,
+ /pgfplots/tickpos/.belongs to family=/pgfplots/tick,
+ /pgfplots/tickpos/left/.code ={\def\pgfplots@xtickposnum{1}\def\pgfplots@ytickposnum{1}},
+ /pgfplots/tickpos/left/.belongs to family=/pgfplots/tick,
+ /pgfplots/tickpos/right/.code ={\def\pgfplots@xtickposnum{3}\def\pgfplots@ytickposnum{3}},
+ /pgfplots/tickpos/right/.belongs to family=/pgfplots/tick,
+ /pgfplots/tickpos/both/.code ={\def\pgfplots@xtickposnum{0}\def\pgfplots@ytickposnum{0}},
+ /pgfplots/tickpos/both/.belongs to family=/pgfplots/tick,
+ /pgfplots/tickpos=both,
+% sets \pgfplots@{x,y}tickalignnum to
+% inside=0
+% outside=1
+% center=2
+ /pgfplots/tick align/.is choice,
+ /pgfplots/tick align/.belongs to family=/pgfplots/tick,
+ /pgfplots/tick align/inside/.code ={\def\pgfplots@xtickalignnum{0}\def\pgfplots@ytickalignnum{0}},
+ /pgfplots/tick align/inside/.belongs to family=/pgfplots/tick,
+ /pgfplots/tick align/outside/.code ={\def\pgfplots@xtickalignnum{1}\def\pgfplots@ytickalignnum{1}},
+ /pgfplots/tick align/outside/.belongs to family=/pgfplots/tick,
+ /pgfplots/tick align/center/.code ={\def\pgfplots@xtickalignnum{2}\def\pgfplots@ytickalignnum{2}},
+ /pgfplots/tick align/center/.belongs to family=/pgfplots/tick,
+ /pgfplots/tick align=inside,
+% 'axis' options:
+ /pgfplots/anchor/.belongs to family=/pgfplots,
+ /pgfplots/anchor/.store in= \pgfplots@anchorname,
+ /pgfplots/anchor=south west,
+% tick options:
+ /pgfplots/ticks/.is choice,
+ /pgfplots/ticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/ticks/none/.belongs to family=/pgfplots/tick,
+ /pgfplots/ticks/none/.code={%
+ \pgfplots@xminorticksfalse
+ \pgfplots@yminorticksfalse
+ \pgfplots@xmajorticksfalse
+ \pgfplots@ymajorticksfalse
+ },
+ /pgfplots/ticks/major/.belongs to family=/pgfplots/tick,
+ /pgfplots/ticks/major/.code={%
+ \pgfplots@xminorticksfalse
+ \pgfplots@yminorticksfalse
+ \pgfplots@xmajortickstrue
+ \pgfplots@ymajortickstrue
+ },
+ /pgfplots/ticks/minor/.belongs to family=/pgfplots/tick,
+ /pgfplots/ticks/minor/.code={%
+ \pgfplots@xminortickstrue
+ \pgfplots@yminortickstrue
+ \pgfplots@xmajorticksfalse
+ \pgfplots@ymajorticksfalse
+ },
+ /pgfplots/ticks/both/.belongs to family=/pgfplots/tick,
+ /pgfplots/ticks/both/.code={%
+ \pgfplots@xminortickstrue
+ \pgfplots@yminortickstrue
+ \pgfplots@xmajortickstrue
+ \pgfplots@ymajortickstrue
+ },
+ /pgfplots/ticks=both,
+ /pgfplots/grid/.is choice,
+ /pgfplots/grid/.belongs to family=/pgfplots/tick,
+ /pgfplots/grid/none/.belongs to family=/pgfplots/tick,
+ /pgfplots/grid/none/.code={%
+ \pgfplots@xminorgridsfalse
+ \pgfplots@yminorgridsfalse
+ \pgfplots@xmajorgridsfalse
+ \pgfplots@ymajorgridsfalse
+ },
+ /pgfplots/grid/major/.belongs to family=/pgfplots/tick,
+ /pgfplots/grid/major/.code={%
+ \pgfplots@xminorgridsfalse
+ \pgfplots@yminorgridsfalse
+ \pgfplots@xmajorgridstrue
+ \pgfplots@ymajorgridstrue
+ },
+ /pgfplots/grid/minor/.belongs to family=/pgfplots/tick,
+ /pgfplots/grid/minor/.code={%
+ \pgfplots@xminorgridstrue
+ \pgfplots@yminorgridstrue
+ \pgfplots@xmajorgridsfalse
+ \pgfplots@ymajorgridsfalse
+ },
+ /pgfplots/grid/both/.belongs to family=/pgfplots/tick,
+ /pgfplots/grid/both/.code={%
+ \pgfplots@xminorgridstrue
+ \pgfplots@yminorgridstrue
+ \pgfplots@xmajorgridstrue
+ \pgfplots@ymajorgridstrue
+ },
+ /pgfplots/grid=none,
+ /pgfplots/grid/.default=major,
+ /pgfplots/xminorticks/.is if=pgfplots@xminorticks,
+ /pgfplots/xminorticks/.default=true,
+ /pgfplots/xminorticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/xmajorticks/.is if=pgfplots@xmajorticks,
+ /pgfplots/xmajorticks/.default=true,
+ /pgfplots/xmajorticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/yminorticks/.is if=pgfplots@yminorticks,
+ /pgfplots/yminorticks/.default=true,
+ /pgfplots/yminorticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/ymajorticks/.is if=pgfplots@ymajorticks,
+ /pgfplots/ymajorticks/.default=true,
+ /pgfplots/ymajorticks/.belongs to family=/pgfplots/tick,
+ /pgfplots/xminorgrids/.is if=pgfplots@xminorgrids,
+ /pgfplots/xminorgrids/.default=true,
+ /pgfplots/xminorgrids/.belongs to family=/pgfplots/tick,
+ /pgfplots/xmajorgrids/.is if=pgfplots@xmajorgrids,
+ /pgfplots/xmajorgrids/.default=true,
+ /pgfplots/xmajorgrids/.belongs to family=/pgfplots/tick,
+ /pgfplots/yminorgrids/.is if=pgfplots@yminorgrids,
+ /pgfplots/yminorgrids/.default=true,
+ /pgfplots/yminorgrids/.belongs to family=/pgfplots/tick,
+ /pgfplots/ymajorgrids/.is if=pgfplots@ymajorgrids,
+ /pgfplots/ymajorgrids/.default=true,
+ /pgfplots/ymajorgrids/.belongs to family=/pgfplots/tick,
+% legend options:
+ /pgfplots/legend columns/.store in=\pgfplots@legend@columns,
+ /pgfplots/legend columns/.belongs to family=/pgfplots/legend,
+ /pgfplots/legend columns=1,
+ /pgfplots/legend plot pos/.is choice,
+ /pgfplots/legend plot pos/.belongs to family=/pgfplots/legend,
+ /pgfplots/legend plot pos/left/.code= {\def\pgfplots@legend@plot@pos{0}},
+ /pgfplots/legend plot pos/left/.belongs to family=/pgfplots/legend,
+ /pgfplots/legend plot pos/right/.code= {\def\pgfplots@legend@plot@pos{1}},
+ /pgfplots/legend plot pos/right/.belongs to family=/pgfplots/legend,
+ /pgfplots/legend plot pos/none/.code= {\def\pgfplots@legend@plot@pos{2}},
+ /pgfplots/legend plot pos/none/.belongs to family=/pgfplots/legend,
+ /pgfplots/legend plot pos=left,
+ /pgfplots/legend image code/.code={%
+ \draw[#1,mark repeat=2,mark phase=2]
+ plot coordinates {
+ (0cm,0cm)
+ (0.3cm,0cm)
+ (0.6cm,0cm)%
+ };%
+ },
+ /pgfplots/legend image code/.belongs to family=/pgfplots/legend,
+% axis description options:
+ /pgfplots/title/.store in= \pgfplots@title,
+ /pgfplots/title/.belongs to family=/pgfplots/descriptions,
+ /pgfplots/title=,
+ /pgfplots/xlabel/.store in= \pgfplots@xlabel,
+ /pgfplots/xlabel/.belongs to family=/pgfplots/descriptions,
+ /pgfplots/xlabel=,
+ /pgfplots/ylabel/.store in= \pgfplots@ylabel,
+ /pgfplots/ylabel/.belongs to family=/pgfplots/descriptions,
+ /pgfplots/ylabel=,
+ /pgfplots/before end axis/.code=,
+ /pgfplots/after end axis/.code=,
+ /pgfplots/extra description/.code=,
+ /pgfplots/extra description/.belongs to family=/pgfplots/descriptions,
+% axis options:
+ /pgfplots/at/.code={\tikz@scan@one@point\pgfplots@set@at#1},
+ /pgfplots/at/.belongs to family=/pgfplots,
+ /pgfplots/clip limits/.is if=pgfplots@clip@limits,
+ /pgfplots/clip limits/.default=true,
+ /pgfplots/clip limits=true,
+ /pgfplots/clip limits/.belongs to family=/pgfplots,
+ /pgfplots/xmin/.belongs to family=/pgfplots,
+ /pgfplots/xmin/.initial=,
+ /pgfplots/xmax/.belongs to family=/pgfplots,
+ /pgfplots/xmax/.initial=,
+ /pgfplots/ymin/.belongs to family=/pgfplots,
+ /pgfplots/ymin/.initial=,
+ /pgfplots/ymax/.belongs to family=/pgfplots,
+ /pgfplots/ymax/.initial=,
+ /pgfplots/stack plots/.is choice,
+ /pgfplots/stack plots/.belongs to family=/pgfplots,
+ /pgfplots/stack plots/x/.code={\pgfplots@stacked@xtrue\pgfplots@stackedmodetrue},
+ /pgfplots/stack plots/x/.belongs to family=/pgfplots,
+ /pgfplots/stack plots/y/.code={\pgfplots@stacked@xfalse\pgfplots@stackedmodetrue},
+ /pgfplots/stack plots/y/.belongs to family=/pgfplots,
+ /pgfplots/stack plots/false/.code={\pgfplots@stackedmodefalse},
+ /pgfplots/stack plots/false/.belongs to family=/pgfplots,
+ /pgfplots/stack plots=false,
+ /pgfplots/reverse stacked plots/.is if=pgfplots@stacked@reverse,
+ /pgfplots/reverse stacked plots/.belongs to family=/pgfplots,
+ /pgfplots/reverse stacked plots/.default=true,
+ /pgfplots/reverse stacked plots=true,
+ /pgfplots/stack dir/.is choice,
+ /pgfplots/stack dir/.belongs to family=/pgfplots,
+ /pgfplots/stack dir/plus/.code={\pgfplots@stacked@plustrue},
+ /pgfplots/stack dir/plus/.belongs to family=/pgfplots,
+ /pgfplots/stack dir/minus/.code={\pgfplots@stacked@plusfalse},
+ /pgfplots/stack dir/minus/.belongs to family=/pgfplots,
+ /pgfplots/stack dir=plus,
+ /pgfplots/filter discard warning/.is if=pgfplots@warn@for@filter@discards,
+ /pgfplots/filter discard warning=true,
+ /pgfplots/x filter/.code={},
+ /pgfplots/x filter/.belongs to family=/pgfplots,
+ /pgfplots/y filter/.code={},
+ /pgfplots/y filter/.belongs to family=/pgfplots,
+ /pgfplots/skip coords between index/.style 2 args={%
+ /pgfplots/x filter/.append code={%
+ \ifnum\coordindex<#1\relax
+ \else
+ \ifnum\coordindex<#2\relax
+ \let\pgfmathresult=\pgfutil@empty
+ \fi
+ \fi}
+ },
+ /pgfplots/xfilter/.initial=,% DEPRECATED
+ /pgfplots/xfilter/.belongs to family=/pgfplots,
+ /pgfplots/yfilter/.initial=,% DEPRECATED
+ /pgfplots/yfilter/.belongs to family=/pgfplots,
+ /pgfplots/width/.store in= \pgfplots@width,
+ /pgfplots/width/.belongs to family=/pgfplots,
+ /pgfplots/width=,
+ /pgfplots/height/.store in= \pgfplots@height,
+ /pgfplots/height/.belongs to family=/pgfplots,
+ /pgfplots/height=,
+ /pgfplots/execute at begin plot/.store in=\pgfplots@execute@at@begin@plot,
+ /pgfplots/execute at begin plot/.belongs to family=/pgfplots,
+ /pgfplots/execute at begin plot=,
+ /pgfplots/execute at end plot/.store in= \pgfplots@execute@at@end@plot,
+ /pgfplots/execute at end plot/.belongs to family=/pgfplots,
+ /pgfplots/execute at end plot=,
+ /pgfplots/enlargelimits/.store in= \pgfplots@enlargelimits,
+ /pgfplots/enlargelimits/.belongs to family=/pgfplots,
+ /pgfplots/enlargelimits=auto,
+ /pgfplots/enlargelimits/.default=true,
+ /pgfplots/x/.store in= \pgfplots@x,
+ /pgfplots/x/.belongs to family=/pgfplots,
+ /pgfplots/x=,% is implicitly set by 'width' and/or '\axisdefaultwidth'
+ /pgfplots/y/.store in= \pgfplots@y,
+ /pgfplots/y/.belongs to family=/pgfplots,
+ /pgfplots/y=,% is implicitly set by 'width' and/or '\axisdefaultwidth'
+ /pgfplots/cycle list/.code={\pgfplots@assign@list\autoplotspeclist{#1}},
+ /pgfplots/cycle list/.belongs to family=/pgfplots,
+ /pgfplots/cycle list name/.code={\let\autoplotspeclist=#1\relax},
+ /pgfplots/cycle list name/.belongs to family=/pgfplots,
+ /pgfplots/cycle list name=\coloredplotspeclist,
+ /pgfplots/legend style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/legend style/.code={%
+ \pgfkeysalso{/pgfplots/every axis legend/.append style={#1}}%
+ },
+ /pgfplots/label style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/label style/.code={%
+ \pgfkeysalso{/pgfplots/every axis label/.append style={#1}}%
+ },%
+ /pgfplots/x label style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/x label style/.code={%
+ \pgfkeysalso{/pgfplots/every axis x label/.append style={#1}}%
+ },
+ /pgfplots/y label style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/y label style/.code={%
+ \pgfkeysalso{/pgfplots/every axis y label/.append style={#1}}%
+ },
+ /pgfplots/title style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/title style/.code={%
+ \pgfkeysalso{/pgfplots/every axis title/.append style={#1}}%
+ },
+ /pgfplots/tick label style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/tick label style/.code={%
+ \pgfkeysalso{/pgfplots/every tick label/.append style={#1}}%
+ },
+ /pgfplots/x tick label style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/x tick label style/.code={%
+ \pgfkeysalso{/pgfplots/every x tick label/.append style={#1}}%
+ },
+ /pgfplots/y tick label style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/y tick label style/.code={%
+ \pgfkeysalso{/pgfplots/every y tick label/.append style={#1}}%
+ },
+ /pgfplots/x tick scale label style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/x tick scale label style/.code={%
+ \pgfkeysalso{/pgfplots/every x scale tick label/.append style={#1}}%
+ },
+ /pgfplots/y tick scale label style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/y tick scale label style/.code={%
+ \pgfkeysalso{/pgfplots/every y scale tick label/.append style={#1}}%
+ },
+ /pgfplots/tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/tick style/.code={%
+ \pgfkeysalso{/pgfplots/every tick/.append style={#1}}%
+ },
+ /pgfplots/minor tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/minor tick style/.code={%
+ \pgfkeysalso{/pgfplots/every minor tick/.append style={#1}}%
+ },
+ /pgfplots/major tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/major tick style/.code={%
+ \pgfkeysalso{/pgfplots/every major tick/.append style={#1}}%
+ },
+ /pgfplots/x tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/x tick style/.code={%
+ \pgfkeysalso{/pgfplots/every x tick/.append style={#1}}%
+ },
+ /pgfplots/minor x tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/minor x tick style/.code={%
+ \pgfkeysalso{/pgfplots/every minor x tick/.append style={#1}}%
+ },
+ /pgfplots/major x tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/major x tick style/.code={%
+ \pgfkeysalso{/pgfplots/every major x tick/.append style={#1}}%
+ },
+ /pgfplots/y tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/y tick style/.code={%
+ \pgfkeysalso{/pgfplots/every y tick/.append style={#1}}%
+ },
+ /pgfplots/minor y tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/minor y tick style/.code={%
+ \pgfkeysalso{/pgfplots/every minor y tick/.append style={#1}}%
+ },
+ /pgfplots/major y tick style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/major y tick style/.code={%
+ \pgfkeysalso{/pgfplots/every major y tick/.append style={#1}}%
+ },
+ /pgfplots/grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/grid style/.code={%
+ \pgfkeysalso{/pgfplots/every axis grid/.append style={#1}}%
+ },
+ /pgfplots/minor grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/minor grid style/.code={%
+ \pgfkeysalso{/pgfplots/every minor grid/.append style={#1}}%
+ },
+ /pgfplots/major grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/major grid style/.code={%
+ \pgfkeysalso{/pgfplots/every major grid/.append style={#1}}%
+ },
+ /pgfplots/x grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/x grid style/.code={%
+ \pgfkeysalso{/pgfplots/every axis x grid/.append style={#1}}%
+ },
+ /pgfplots/minor x grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/minor x grid style/.code={%
+ \pgfkeysalso{/pgfplots/every minor x grid/.append style={#1}}%
+ },
+ /pgfplots/major x grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/major x grid style/.code={%
+ \pgfkeysalso{/pgfplots/every major x grid/.append style={#1}}%
+ },
+ /pgfplots/y grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/y grid style/.code={%
+ \pgfkeysalso{/pgfplots/every axis y grid/.append style={#1}}%
+ },
+ /pgfplots/minor y grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/minor y grid style/.code={%
+ \pgfkeysalso{/pgfplots/every minor y grid/.append style={#1}}%
+ },
+ /pgfplots/major y grid style/.belongs to family=/pgfplots/style commands,
+ /pgfplots/major y grid style/.code={%
+ \pgfkeysalso{/pgfplots/every major y grid/.append style={#1}}%
+ },
+ /pgfplots/disablelogfilter/.is if=pgfplots@disablelogfilter,
+ /pgfplots/disablelogfilter/.default=true,
+ /pgfplots/disablelogfilter/.belongs to family=/pgfplots,
+ /pgfplots/disablelogfilter=false,
+ /pgfplots/disabledatascaling/.is if=pgfplots@disabledatascaling,
+ /pgfplots/disabledatascaling/.default=true,
+ /pgfplots/disabledatascaling/.belongs to family=/pgfplots,
+ /pgfplots/disabledatascaling=false,
+ /pgfplots/hide axis/.is if=pgfplots@hide,
+ /pgfplots/hide axis/.default=true,
+ /pgfplots/hide axis/.belongs to family=/pgfplots,
+ /pgfplots/hide axis=false,
+% sets \pgfplots@xaxislinesnum to
+% box=0
+% bottom=1
+% middle=2
+% top=3
+ /pgfplots/axis x line/.is choice,
+ /pgfplots/axis x line/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x line/box/.code ={\def\pgfplots@xaxislinesnum{0}\def\pgfplots@xtickposnum{0}},
+ /pgfplots/axis x line/box/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x line/bottom/.code ={\def\pgfplots@xaxislinesnum{1}\def\pgfplots@xtickposnum{1}},
+ /pgfplots/axis x line/bottom/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x line/middle/.code ={\def\pgfplots@xaxislinesnum{2}\def\pgfplots@xtickposnum{2}},
+ /pgfplots/axis x line/middle/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x line/top/.code ={\def\pgfplots@xaxislinesnum{3}\def\pgfplots@xtickposnum{3}},
+ /pgfplots/axis x line/top/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x line/none/.code ={\def\pgfplots@xaxislinesnum{4}\def\pgfplots@xtickposnum{4}},
+ /pgfplots/axis x line/none/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x line=box,
+% sets \pgfplots@yaxislinesnum to
+% box=0
+% left=1
+% center=2
+% right=3
+ /pgfplots/axis y line/.is choice,
+ /pgfplots/axis y line/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y line/box/.code ={\def\pgfplots@yaxislinesnum{0}\def\pgfplots@ytickposnum{0}},
+ /pgfplots/axis y line/box/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y line/left/.code ={\def\pgfplots@yaxislinesnum{1}\def\pgfplots@ytickposnum{1}},
+ /pgfplots/axis y line/left/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y line/center/.code ={\def\pgfplots@yaxislinesnum{2}\def\pgfplots@ytickposnum{2}},
+ /pgfplots/axis y line/center/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y line/right/.code ={\def\pgfplots@yaxislinesnum{3}\def\pgfplots@ytickposnum{3}},
+ /pgfplots/axis y line/right/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y line/none/.code ={\def\pgfplots@yaxislinesnum{4}\def\pgfplots@ytickposnum{4}},
+ /pgfplots/axis y line/none/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y line=box,
+% set \pgfplots@xaxisdiscontnum
+% none = 0
+% crunch = 1
+% open = 2
+ /pgfplots/axis x discontinuity/.is choice,
+ /pgfplots/axis x discontinuity/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x discontinuity/none/.code ={\def\pgfplots@xaxisdiscontnum{0}},
+ /pgfplots/axis x discontinuity/none/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x discontinuity/crunch/.code ={\def\pgfplots@xaxisdiscontnum{1}},
+ /pgfplots/axis x discontinuity/crunch/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x discontinuity/parallel/.code ={\def\pgfplots@xaxisdiscontnum{2}},
+ /pgfplots/axis x discontinuity/parallel/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis x discontinuity=none,
+% set \pgfplots@yaxisdiscontnum
+% none = 0
+% crunch = 1
+% open = 2
+ /pgfplots/axis y discontinuity/.is choice,
+ /pgfplots/axis y discontinuity/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y discontinuity/none/.code ={\def\pgfplots@yaxisdiscontnum{0}},
+ /pgfplots/axis y discontinuity/none/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y discontinuity/crunch/.code ={\def\pgfplots@yaxisdiscontnum{1}},
+ /pgfplots/axis y discontinuity/crunch/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y discontinuity/parallel/.code ={\def\pgfplots@yaxisdiscontnum{2}},
+ /pgfplots/axis y discontinuity/parallel/.belongs to family=/pgfplots, %/axis,
+ /pgfplots/axis y discontinuity=none,
+ /pgfplots/scale only axis/.is if=pgfplots@scale@only@axis,
+ /pgfplots/scale only axis/.default=true,
+ /pgfplots/scale only axis/.belongs to family=/pgfplots,
+ /pgfplots/scale only axis=false,
+% sets \pgfplots@xislinear to
+% normal=true
+% log=false
+ /pgfplots/xmode/.is choice,
+ /pgfplots/xmode/.belongs to family=/pgfplots/scale,
+ /pgfplots/xmode/normal/.code={\pgfplots@xislineartrue},
+ /pgfplots/xmode/normal/.belongs to family=/pgfplots/scale,
+ /pgfplots/xmode/linear/.code={\pgfplots@xislineartrue},
+ /pgfplots/xmode/linear/.belongs to family=/pgfplots/scale,
+ /pgfplots/xmode/log/.code={\pgfplots@xislinearfalse},
+ /pgfplots/xmode/log/.belongs to family=/pgfplots/scale,
+ /pgfplots/xmode=linear,
+ /pgfplots/ymode/.is choice,
+ /pgfplots/ymode/.belongs to family=/pgfplots/scale,
+ /pgfplots/ymode/normal/.code={\pgfplots@yislineartrue},
+ /pgfplots/ymode/normal/.belongs to family=/pgfplots/scale,
+ /pgfplots/ymode/linear/.code={\pgfplots@yislineartrue},
+ /pgfplots/ymode/linear/.belongs to family=/pgfplots/scale,
+ /pgfplots/ymode/log/.code={\pgfplots@yislinearfalse},
+ /pgfplots/ymode/log/.belongs to family=/pgfplots/scale,
+ /pgfplots/ymode=linear,
+ /pgfplots/error bars/x fixed/.code= \def\pgfplots@errorbars@xfixed{#1}\def\pgfplots@errorbars@xmode{0},
+ /pgfplots/error bars/x fixed relative/.code= \def\pgfplots@errorbars@xrel{#1}\def\pgfplots@errorbars@xmode{1},
+ /pgfplots/error bars/x explicit/.code= \def\pgfplots@errorbars@xmode{2},
+ /pgfplots/error bars/x explicit relative/.code= \def\pgfplots@errorbars@xmode{3},
+ /pgfplots/error bars/x fixed relative=0,
+ /pgfplots/error bars/x fixed=0,
+ /pgfplots/error bars/y fixed/.code= \def\pgfplots@errorbars@yfixed{#1}\def\pgfplots@errorbars@ymode{0},
+ /pgfplots/error bars/y fixed relative/.code= \def\pgfplots@errorbars@yrel{#1}\def\pgfplots@errorbars@ymode{1},
+ /pgfplots/error bars/y explicit/.code= \def\pgfplots@errorbars@ymode{2},
+ /pgfplots/error bars/y explicit relative/.code= \def\pgfplots@errorbars@ymode{3},
+ /pgfplots/error bars/y fixed relative=0,
+ /pgfplots/error bars/y fixed=0,
+ /pgfplots/error bars/x dir/.is choice,
+ /pgfplots/error bars/x dir/none/.code={%
+ \def\pgfplots@errorbars@xdirection{0}%
+ \ifnum\pgfplots@errorbars@ydirection=0
+ \pgfplots@errorbars@enabledfalse
+ \fi
+ },
+ /pgfplots/error bars/x dir/plus/.code= \def\pgfplots@errorbars@xdirection{1}\pgfplots@errorbars@enabledtrue,
+ /pgfplots/error bars/x dir/minus/.code= \def\pgfplots@errorbars@xdirection{2}\pgfplots@errorbars@enabledtrue,
+ /pgfplots/error bars/x dir/both/.code= \def\pgfplots@errorbars@xdirection{3}\pgfplots@errorbars@enabledtrue,
+ /pgfplots/error bars/x dir=none,
+ /pgfplots/error bars/y dir/.is choice,
+ /pgfplots/error bars/y dir/none/.code={%
+ \def\pgfplots@errorbars@ydirection{0}%
+ \ifnum\pgfplots@errorbars@xdirection=0
+ \pgfplots@errorbars@enabledfalse
+ \fi
+ },
+ /pgfplots/error bars/y dir/plus/.code= \def\pgfplots@errorbars@ydirection{1}\pgfplots@errorbars@enabledtrue,
+ /pgfplots/error bars/y dir/minus/.code= \def\pgfplots@errorbars@ydirection{2}\pgfplots@errorbars@enabledtrue,
+ /pgfplots/error bars/y dir/both/.code= \def\pgfplots@errorbars@ydirection{3}\pgfplots@errorbars@enabledtrue,
+ /pgfplots/error bars/y dir=none,
+ /pgfplots/error bars/error mark/.initial={-},
+ /pgfplots/error bars/error mark options/.initial={rotate=90},
+ /pgfplots/error bars/error bar style/.code={%
+ \pgfkeysalso{/pgfplots/every error bar/.append style={#1}}%
+ },
+ /pgfplots/every error bar/.style={thin},
+ /pgfplots/every error bar/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every error bar}},
+ /pgfplots/error bars/draw error bar/.code 2 args={%
+%\message{/pgfplots/error bars/draw error bar: working with '#1' -- '#2'.}%
+ \pgfkeysgetvalue{/pgfplots/error bars/error mark}{\pgfplotserrorbarsmark}%
+ \pgfkeysgetvalue{/pgfplots/error bars/error mark options}{\pgfplotserrorbarsmarkopts}%
+ \draw #1 -- #2 node[pos=1,sloped,allow upside down] {%
+ \expandafter\tikz\expandafter[\pgfplotserrorbarsmarkopts]{%
+ \expandafter\pgfuseplotmark\expandafter{\pgfplotserrorbarsmark}%
+ \pgfusepath{stroke}}%
+ };
+ },
+ /pgfplots/bar cycle list/.style={/pgfplots/cycle list={%
+ {blue,fill=blue!30!white,mark=none},%
+ {red,fill=red!30!white,mark=none},%
+ {brown!60!black,fill=brown!30!white,mark=none},%
+ {black,fill=gray,mark=none},%
+ }
+ },
+ /pgfplots/area cycle list/.style={bar cycle list},
+ /pgfplots/ybar/.style={
+ bar cycle list,
+ tick align=outside,
+ /pgfplots/legend image code/.code={\draw[##1,bar width=3pt,yshift=-0.2em,bar shift=0pt] plot coordinates {(0cm,0.8em) (2*\pgfplotbarwidth,0.6em)};},
+ /pgf/bar shift={%
+ % total width = n*w + (n-1)*skip
+ % -> subtract half for centering
+ -0.5*(\numplots*\pgfplotbarwidth + (\numplots-1)*#1) +
+ % the '0.5*w' is for centering
+ (.5+\plotnum)*\pgfplotbarwidth + \plotnum*#1},%
+ /tikz/ybar,
+ },
+ /pgfplots/ybar/.default=2pt,
+ /pgfplots/ybar/.belongs to family=/pgfplots,
+ /pgfplots/xbar/.style={
+ bar cycle list,
+ tick align=outside,
+ /pgfplots/legend image code/.code={\draw[##1,bar width=3pt,yshift=-0.2em,bar shift=0pt] plot coordinates {(0cm,0.8em) (2*\pgfplotbarwidth,0.6em)};},
+ /pgf/bar shift={%
+ % total width = n*w + (n-1)*skip
+ % -> subtract half for centering
+ -0.5*(\numplots*\pgfplotbarwidth + (\numplots-1)*#1) +
+ % the '0.5*w' is for centering
+ (.5+\plotnum)*\pgfplotbarwidth + \plotnum*#1},%
+ /tikz/xbar,
+ },
+ /pgfplots/xbar/.default=2pt,
+ /pgfplots/xbar/.belongs to family=/pgfplots,
+ /pgfplots/ybar interval/.style={%
+ bar cycle list,
+ x tick label as interval,
+ xmajorgrids,
+ % xtick=data,
+ /pgfplots/legend image code/.code={\draw[##1,yshift=-0.2em,bar interval width=0.7,bar interval shift=0.5] plot coordinates {(0cm,0.8em) (5pt,0.6em) (10pt,0.6em)};},
+ bar interval width={#1/\numplots},
+ bar interval shift={(\plotnum+0.5)/\numplots},
+ /tikz/ybar interval,
+ },
+ /pgfplots/ybar interval/.default=1,
+ /pgfplots/ybar interval/.belongs to family=/pgfplots,
+ /pgfplots/xbar interval/.style={%
+ bar cycle list,
+ y tick label as interval,
+ % ytick=data,
+ ymajorgrids,
+ /pgfplots/legend image code/.code={\draw[##1,yshift=-0.2em,bar interval width=0.7,bar interval shift=0.5] plot coordinates {(0cm,0.8em) (5pt,0.6em) (10pt,0.6em)};},
+ bar interval width={#1/\numplots},
+ bar interval shift={(\plotnum+0.5)/\numplots},
+ /tikz/xbar interval,
+ },
+ /pgfplots/xbar interval/.default=1,
+ /pgfplots/xbar interval/.belongs to family=/pgfplots,
+ /pgfplots/xbar stacked/.style={
+ bar cycle list,
+ stack plots=x,
+ stack dir=#1,
+ /tikz/xbar,
+ },
+ /pgfplots/xbar stacked/.default=plus,
+ /pgfplots/xbar stacked/.belongs to family=/pgfplots,
+ /pgfplots/ybar stacked/.style={
+ bar cycle list,
+ stack plots=y,
+ stack dir=#1,
+ /tikz/ybar,
+ },
+ /pgfplots/ybar stacked/.default=plus,
+ /pgfplots/ybar stacked/.belongs to family=/pgfplots,
+ /pgfplots/xbar interval stacked/.style={
+ bar cycle list,
+ stack plots=x,
+ stack dir=#1,
+ /tikz/xbar interval,
+ },
+ /pgfplots/xbar interval stacked/.default=plus,
+ /pgfplots/xbar interval stacked/.belongs to family=/pgfplots,
+ /pgfplots/ybar interval stacked/.style={
+ bar cycle list,
+ stack plots=y,
+ stack dir=#1,
+ /tikz/ybar interval,
+ },
+ /pgfplots/ybar interval stacked/.default=plus,
+ /pgfplots/ybar interval stacked/.belongs to family=/pgfplots,
+ /pgfplots/yticklabel interval boundaries/.style={%
+ y tick label as interval,
+ yticklabel={$\pgfmathprintnumber{\tick}$ -- $\pgfmathprintnumber{\nexttick}$}
+ },
+ /pgfplots/xticklabel interval boundaries/.style={%
+ x tick label as interval,
+ xticklabel={$\pgfmathprintnumber{\tick}$ -- $\pgfmathprintnumber{\nexttick}$}
+ },
+}
+
+\newif\ifpgfplots@log@tick@isminor@tick@pos
+% Checks whether the tick position given as #1.#2=log10(T) belongs to
+% T=i*10^j with an integer i>1.
+%
+% If T=i*10^j, \ifpgfplots@log@tick@isminor@tick@pos will be set to true and
+% \pgfmathresult will contain T.
+%
+% Otherwise, \ifpgfplots@log@tick@isminor@tick@pos will be set to false and
+% pgfmathresult to #1.#2
+%
+% Arguments:
+% #1.#2 the value log10(T)
+%
+% Implementation:
+% if T = i*10^j, log10(T) = log10(i) + j.
+% That means if log10(T) in \Z, we have T = 10^j. If not, we need to
+% check wether i is an integer. Please note that log10(i) < 1.
+%
+% Further note: log(T) < 0 <=> j<0.
+% In case j<0, we have
+% #1.#2 = j + log(i)
+% = - ( -j - log(i) )
+% = - ( -j - 1 + (1-log(i)) )
+% = #1 '.' #2 [ up to the '0.'
+% that means #1 = j-1 and #2 = 1-log(i).
+\def\pgfplots@is@log@tick@a@minor@tick@pos#1.#2\relax{%
+ \pgfmathapproxequalto@{#1.#2}{#1.0}%
+ \ifpgfmathcomparison
+ % in MOST cases, this here will be true:
+ \pgfplots@log@tick@isminor@tick@posfalse
+ \def\pgfmathresult{#1.#2}%
+ \else
+ % I guess this won't happen too often. In fact, it's a very
+ % special case.
+ \begingroup
+ \c@pgf@counta=#1\relax
+ \ifnum\c@pgf@counta<0
+ \advance\c@pgf@counta by-1
+ \pgfmathsubtract@{1}{0.#2}%
+ \expandafter\pgfplots@is@log@tick@a@minor@tick@pos@IDENTIFY@LOGi\pgfmathresult\relax
+ \ifpgfplots@log@tick@isminor@tick@pos
+ \aftergroup\pgfplots@log@tick@isminor@tick@postrue
+ \edef\pgfmathresult{\pgfmathresult e\the\c@pgf@counta}%
+ \else
+ \aftergroup\pgfplots@log@tick@isminor@tick@posfalse
+ \def\pgfmathresult{#1.#2}%
+ \fi
+ \else
+ \pgfplots@is@log@tick@a@minor@tick@pos@IDENTIFY@LOGi0.#2\relax
+ \ifpgfplots@log@tick@isminor@tick@pos
+ \aftergroup\pgfplots@log@tick@isminor@tick@postrue
+ \edef\pgfmathresult{\pgfmathresult e\the\c@pgf@counta}%
+ \else
+ \aftergroup\pgfplots@log@tick@isminor@tick@posfalse
+ \def\pgfmathresult{#1.#2}%
+ \fi
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ \fi
+}
+
+% expects a positive number.
+\def\pgfplots@is@log@tick@a@minor@tick@pos@IDENTIFY@LOGi0.#1\relax{%
+ \pgfplots@log@tick@isminor@tick@postrue
+ \pgfmathapproxequalto@{0.#1}{0.3010299956639}%
+ \ifpgfmathcomparison
+ \def\pgfmathresult{2}%
+ \else
+ \pgfmathapproxequalto@{0.#1}{0.4771212547196}%
+ \ifpgfmathcomparison
+ \def\pgfmathresult{3}%
+ \else
+ \pgfmathapproxequalto@{0.#1}{0.6020599913279}%
+ \ifpgfmathcomparison
+ \def\pgfmathresult{4}%
+ \else
+ \pgfmathapproxequalto@{0.#1}{0.698970004}%
+ \ifpgfmathcomparison
+ \def\pgfmathresult{5}%
+ \else
+ \pgfmathapproxequalto@{0.#1}{0.7781512503}%
+ \ifpgfmathcomparison
+ \def\pgfmathresult{6}%
+ \else
+ \pgfmathapproxequalto@{0.#1}{0.8450980400}%
+ \ifpgfmathcomparison
+ \def\pgfmathresult{7}%
+ \else
+ \pgfmathapproxequalto@{0.#1}{0.9030899869}%
+ \ifpgfmathcomparison
+ \def\pgfmathresult{8}%
+ \else
+ \pgfmathapproxequalto@{0.#1}{0.954242509439}%
+ \ifpgfmathcomparison
+ \def\pgfmathresult{9}%
+ \else
+ \pgfplots@log@tick@isminor@tick@posfalse
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+
+\def\pgfplots@set@at#1{\def\pgfplots@at{#1}}%
+
+
+
+% converts a comma-separated list (PGF foreach) to my internal list
+% structure.
+\long\def\pgfplots@foreach@to@list#1\to#2{%
+ \pgfplotslistnewempty\pgfplots@TMP
+ \begingroup
+ \foreach \i in {#1} {%
+ \globaldefs=1
+ \expandafter\pgfplotslistpushback\i\to\pgfplots@TMP
+ \globaldefs=0
+ }%
+ \endgroup
+ \pgfplotslistcopy\pgfplots@TMP\to#2\relax
+}
+
+% Several tick options:
+\long\def\axispreset#1{%
+ \pgfplotsset{every axis/.append style={#1}}%
+}
+\long\def\legendpreset#1{%
+ \pgfplots@error{Sorry, legendpreset is now deprecated, along with the legend options text width and font. Legends are now TikZ-matrizes which provide better alignment and can be placed horizontally. See the manual for details.}%
+}
+
+% Checks whether we need to create a separate 'tick scale label',
+% a node with ' * 10^3' on the side of the axis:
+%
+% PRECONDITION:
+% Axis limits for #1 are given. I need their values before any data
+% scale transformation has been applied.
+% If
+% \pgfplots@#1min@unscaled@as@float
+% and
+% \pgfplots@#1max@unscaled@as@float
+% exist; I will use these macros.
+% Otherwise, I will use \pgfplots@#1min and \pgfplots@#1max;
+% assuming that no data scale transformation is active.
+% FIXME : does that need further attention?
+\def\pgfplots@init@scaled@tick@for#1{%
+ \begingroup
+ % the \pgfplots@xmin@unscaled@as@float is set just before the data
+ % scale transformation is initialised.
+ %
+ % The variables are empty if there is no datascale transformation.
+ \expandafter\let\expandafter\pgfplots@cur@min@unscaled\csname pgfplots@#1min@unscaled@as@float\endcsname
+ \expandafter\let\expandafter\pgfplots@cur@max@unscaled\csname pgfplots@#1max@unscaled@as@float\endcsname
+ %
+ \ifx\pgfplots@cur@min@unscaled\pgfutil@empty
+ \xdef\pgfplots@TMP{\csname pgfplots@#1min\endcsname}%
+ \expandafter\pgfmathfloatparsenumber\expandafter{\pgfplots@TMP}%
+ \let\pgfplots@cur@min@unscaled=\pgfmathresult
+ \xdef\pgfplots@TMP{\csname pgfplots@#1max\endcsname}%
+ \expandafter\pgfmathfloatparsenumber\expandafter{\pgfplots@TMP}%
+ \let\pgfplots@cur@max@unscaled=\pgfmathresult
+ \fi
+ %
+ \expandafter\pgfmathfloat@decompose@E\pgfplots@cur@min@unscaled\relax\pgfmathfloat@a@E
+ \expandafter\pgfmathfloat@decompose@E\pgfplots@cur@max@unscaled\relax\pgfmathfloat@b@E
+ \ifnum\pgfmathfloat@b@E<\pgfmathfloat@a@E
+ \pgfmathfloat@b@E=\pgfmathfloat@a@E
+ \fi
+ \xdef\pgfplots@TMP{\pgfplots@scale@ticks@above@exponent}%
+ \expandafter\ifnum\pgfplots@TMP<\pgfmathfloat@b@E
+ % ok, scale it:
+ \multiply\pgfmathfloat@b@E by-1
+ \xdef\pgfplots@TMP{\the\pgfmathfloat@b@E}%
+ \else
+ \xdef\pgfplots@TMP{\pgfplots@scale@ticks@below@exponent}%
+ \expandafter\ifnum\pgfplots@TMP>\pgfmathfloat@b@E
+ % ok, scale it:
+ \multiply\pgfmathfloat@b@E by-1
+ \xdef\pgfplots@TMP{\the\pgfmathfloat@b@E}%
+ \else
+ % no scaling necessary:
+ \xdef\pgfplots@TMP{0}%
+ \fi
+ \fi
+ \endgroup
+ \expandafter\let\csname pgfplots@tick@scale@#1\endcsname=\pgfplots@TMP%
+}
+
+% x-axis tick labels for #1th tick
+% #1: options
+% #2: the axis (x or y)
+% #3: the value
+% #4,#5: coordinates for tikz
+% #6: ticknumber
+\def\pgfplots@show@ticklabel[#1]#2#3(#4,#5)#6{{%
+ \csname ifpgfplots@#2ticklabel@interval\endcsname
+ \pgfmathparse{#4}%
+ \edef\pgfplots@show@ticklabel@coord@x@new{\pgfmathresult pt}%
+ \pgfmathparse{#5}%
+ \edef\pgfplots@show@ticklabel@coord@y@new{\pgfmathresult pt}%
+ %
+ \pgfplots@show@ticklabel@{#2}{#3}%
+ \let\nexttick=\tick
+ \ifx\pgfplots@show@ticklabel@LASTTICK\pgfutil@empty
+ % its the first call. Simply remember arguments and wait
+ % for interval boundary before proceeding.
+ \else
+ % acquire options of first interval boundary:
+ \pgfplots@show@ticklabel@LASTTICK
+ % compute new node position:
+ \pgfmathparse{0.5*(\csname pgfplots@show@ticklabel@coord@#2\endcsname + \csname pgfplots@show@ticklabel@coord@#2@new\endcsname)}%
+ \expandafter\edef\csname pgfplots@show@ticklabel@coord@#2\endcsname{\pgfmathresult pt}%
+ \let\ticknum=\pgfplots@show@ticklabel@num\relax%
+ \let\tick=\pgfplots@show@ticklabel@tick%
+ \pgfplots@toka=\expandafter{\pgfplots@show@ticklabel@opts}%
+ \xdef\pgfplots@TMP{at (\pgfplots@show@ticklabel@coord@x,\pgfplots@show@ticklabel@coord@y) [\the\pgfplots@toka]}%
+ \expandafter\node\pgfplots@TMP
+ {\csname pgfplots@#2ticklabel\endcsname};%
+ \fi
+ \xdef\pgfplots@show@ticklabel@LASTTICK{%
+ \noexpand\def\noexpand\pgfplots@show@ticklabel@opts{#1}%
+ \noexpand\def\noexpand\pgfplots@show@ticklabel@tick{\nexttick}%
+ \noexpand\def\noexpand\pgfplots@show@ticklabel@coord@x{\pgfplots@show@ticklabel@coord@x@new}%
+ \noexpand\def\noexpand\pgfplots@show@ticklabel@coord@y{\pgfplots@show@ticklabel@coord@y@new}%
+ \noexpand\def\noexpand\pgfplots@show@ticklabel@num{\the#6}%
+ }%
+ \else
+ \let\ticknum=#6\relax%
+ \pgfplots@show@ticklabel@{#2}{#3}%
+ \node at (#4,#5) [#1] {\csname pgfplots@#2ticklabel\endcsname};%
+ \fi
+}}
+
+% Defines \tick by applying any necessary math to the (possibly
+% transformed) tick value #2.
+%
+% #1: axis (x or y)
+% #2: tick value.
+\def\pgfplots@show@ticklabel@#1#2{%
+ \csname ifpgfplots@apply@datatrafo@#1\endcsname
+ \csname pgfplots@inverse@datascaletrafo@#1\endcsname{#2}%
+ % FIXME: do that for any linear axis, also if no datascale is
+ % applied!
+ \ifpgfplots@scaled@ticks
+ \expandafter\pgfmathfloatshift@\expandafter{\pgfmathresult}{\csname pgfplots@tick@scale@#1\endcsname}%
+ \fi
+ % .. and this here provides \tick as fixed point repr:
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+ \let\tick=\pgfmathresult
+ \else
+ \edef\tick{#2}%
+ \fi
+}%
+
+\def\pgfplots@user@ticklabel@list@x{%
+ \pgfplotslistselect\ticknum\of\pgfplots@xticklabels\to\tick
+ \tick
+}
+\def\pgfplots@user@ticklabel@list@y{%
+ \pgfplotslistselect\ticknum\of\pgfplots@yticklabels\to\tick
+ \tick
+}
+\def\pgfplots@user@extra@ticklabel@list@x{%
+ \pgfplotslistselect\ticknum\of\pgfplots@extra@xticklabels\to\tick
+ \tick
+}
+\def\pgfplots@user@extra@ticklabel@list@y{%
+ \pgfplotslistselect\ticknum\of\pgfplots@extra@yticklabels\to\tick
+ \tick
+}
+
+\def\axisdefaultticklabel{%
+ $\pgfmathprintnumber{\tick}$%
+}
+
+\def\axisdefaultticklabellog{%
+ \pgfkeysgetvalue{/pgfplots/log number format code/.@cmd}\pgfplots@log@label@style
+ \expandafter\pgfplots@log@label@style\tick\pgfeov
+}
+
+
+\def\pgfplots@show@label#1{%
+ \node
+ [/pgfplots/every axis label,%
+ /pgfplots/every axis #1 label]
+ {\csname pgfplots@#1label\endcsname};
+}
+
+\def\pgfplots@show@title{%
+ \node%
+ [/pgfplots/every axis title]
+ {\pgfplots@title};
+}
+
+% Check if a label does not cross the x-axis
+\def\pgfplots@ytick@check@tickshow{%
+ \pgfplots@tickshowtrue
+ \ifnum\pgfplots@yaxislinesnum=2\relax
+ \ifcase\pgfplots@xaxislinesnum\relax
+ \ifdim\pgfplots@tmpa=\pgfplots@ycoordminTEX\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \ifdim\pgfplots@tmpa=\pgfplots@ycoordmaxTEX\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \or
+ \ifdim\pgfplots@tmpa=\pgfplots@ycoordminTEX\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \or
+ \ifdim\pgfplots@tmpa=\pgfplots@ZERO@y\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \or
+ \ifdim\pgfplots@tmpa=\pgfplots@ycoordmaxTEX\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \fi
+ \fi
+}
+
+\def\pgfplots@drawyaxis@placecomputedtick#1[#2]{%
+ \ifcase\pgfplots@ytickalignnum\relax
+ \def\pgfplots@ytick@offset{0pt}
+ \or
+ \def\pgfplots@ytick@offset{#1}
+ \or
+ \def\pgfplots@ytick@offset{.5*#1}
+ \fi
+ %\pgfplots@ytick@check@tickshow
+ %\ifpgfplots@tickshow
+ \draw[#2]
+ \ifcase\pgfplots@ytickposnum
+ (\pgfplots@xcoordminTEX-\pgfplots@ytick@offset, \pgfplots@tmpa) -- ++( #1, 0pt)
+
+ (\pgfplots@xcoordmaxTEX+\pgfplots@ytick@offset, \pgfplots@tmpa) -- ++(-#1, 0pt)
+ \or
+ (\pgfplots@xcoordminTEX-\pgfplots@ytick@offset, \pgfplots@tmpa) -- ++( #1, 0pt)
+ \or
+ (\pgfplots@ZERO@x -\pgfplots@ytick@offset, \pgfplots@tmpa) -- ++( #1, 0pt)
+ \or
+ (\pgfplots@xcoordmaxTEX+\pgfplots@ytick@offset, \pgfplots@tmpa) -- ++(-#1, 0pt)
+ \fi
+ ;
+ %\fi
+}%
+\def\pgfplots@drawyaxis@placecomputedgridline[#1]{%
+ \draw[#1]
+ (\pgfplots@xcoordminTEX\pgfplots@leftover, \pgfplots@tmpa)
+ -- (\pgfplots@xcoordmaxTEX\pgfplots@rightover, \pgfplots@tmpa)
+ ;
+}%
+
+% Y-Achsen und Achsenbeschriftung LOG:
+% 1: Ticks
+\newif\ifpgfplots@needsminorloop
+\def\pgfplots@drawyaxis#1{%
+ \ifpgfplots@yislinear
+ \ifpgfplots@scaled@ticks
+ \pgfplots@init@scaled@tick@for y%
+ \fi
+ \fi
+ \begingroup
+ \global\pgfplots@ticknum=0
+ \edef\pgfplots@TMP{#1}%
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \ifpgfplots@yminorticks
+ \pgfplots@needsminorlooptrue
+ \fi
+ \ifpgfplots@yminorgrids
+ \pgfplots@needsminorlooptrue
+ \fi
+ \ifpgfplots@needsminorloop
+ \ifpgfplots@yislinear
+ \begingroup
+ \c@pgf@counta=\pgfplots@minor@ytick@num\relax
+ \advance\c@pgf@counta by1\relax
+ \pgfplots@tmpb=\pgfplots@tick@distance@y pt
+ \divide\pgfplots@tmpb by\c@pgf@counta
+ \edef\pgfmathresult{\pgf@sys@tonumber{\pgfplots@tmpb}}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ \let\pgfplots@minor@tick@dist=\pgfmathresult
+ \else
+ \def\pgfplots@minor@ytick@num{9}%
+ \fi
+ \fi
+ \xdef\pgfplots@show@ticklabel@LASTTICK{}%
+ \foreach \y in {#1} {
+ \pgfextracty{\pgfplots@tmpa}{\pgfpointxy{0}{\y}}%
+ \pgfplots@ytick@check@tickshow
+ %
+ \ifpgfplots@tickshow
+ \ifdim\pgfplots@tmpa<\pgfplots@ycoordminTEX
+ \else
+ \ifdim\pgfplots@tmpa>\pgfplots@ycoordmaxTEX
+ \else
+ \ifcase\pgfplots@ytickalignnum\relax
+ \def\pgfplots@ytick@offset{0pt}%
+ \or
+ \def\pgfplots@ytick@offset{\pgfplots@tickwidth}%
+ \or
+ \def\pgfplots@ytick@offset{.5*\pgfplots@tickwidth}%
+ \fi
+ \ifcase\pgfplots@ytickposnum
+ \def\pgfplots@ytick@origin{\pgfplots@xcoordminTEX}%
+ \or
+ \def\pgfplots@ytick@origin{\pgfplots@xcoordminTEX}%
+ \or
+ \def\pgfplots@ytick@origin{\pgfplots@ZERO@x}%
+ \or
+ \def\pgfplots@ytick@origin{\pgfplots@xcoordmaxTEX}%
+ \fi
+ % Axis tick labels:`
+ \ifnum\pgfplots@ytickposnum=3\relax
+ \pgfplots@show@ticklabel
+ [right,/pgfplots/every tick label,/pgfplots/every y tick label]%
+ {y}{\y}%
+ (\pgfplots@ytick@origin+\pgfplots@ytick@offset,\pgfplots@tmpa)%
+ {\pgfplots@ticknum}%
+ \else
+ \pgfplots@show@ticklabel
+ [left,/pgfplots/every tick label,/pgfplots/every y tick label]%
+ {y}{\y}%
+ (\pgfplots@ytick@origin-\pgfplots@ytick@offset,\pgfplots@tmpa)%
+ {\pgfplots@ticknum}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \global\advance\pgfplots@ticknum by1
+ \scope
+ %\clip (\pgfplots@xcoordminTEX\pgfplots@leftover, \pgfplots@ycoordminTEX\pgfplots@leftover)
+ % rectangle (\pgfplots@xcoordmaxTEX\pgfplots@rightover, \pgfplots@ycoordmaxTEX\pgfplots@rightover);
+ \pgfinterruptboundingbox%
+ \clip (\pgfplots@xcoordminTEX-5cm, \pgfplots@ycoordminTEX)
+ rectangle (\pgfplots@xcoordmaxTEX+5cm, \pgfplots@ycoordmaxTEX);
+ \endpgfinterruptboundingbox%
+ % Y-ticks left and/or right
+ % in log:
+ % log( i*10^k ) = log\i + k\log10 -> draw ticks for i=1..9
+ \ifpgfplots@needsminorloop
+ \foreach \i in {1,...,\pgfplots@minor@ytick@num} {
+ % this code here is scoped inside of \foreach.
+ \ifpgfplots@yislinear
+ \pgfextracty{\pgfplots@tmpb}{\pgfpointxy{0}{\i*\pgfplots@minor@tick@dist}}%
+ \else
+ \pgfextracty{\pgfplots@tmpb}{\pgfpointxy{0}{\logi\i}}%
+ \fi
+ \advance\pgfplots@tmpa by\pgfplots@tmpb
+ \ifdim\pgfplots@tmpa<\pgfplots@ycoordminTEX
+ \else
+ \ifdim\pgfplots@tmpa>\pgfplots@ycoordmaxTEX
+ \else
+ \ifpgfplots@yminorgrids
+ \pgfplots@drawyaxis@placecomputedgridline[/pgfplots/every axis grid,/pgfplots/every minor grid,/pgfplots/every axis y grid,/pgfplots/every minor y grid]%
+ \fi
+ \ifpgfplots@yminorticks
+ \pgfplots@drawyaxis@placecomputedtick\pgfplots@subtickwidth[/pgfplots/every tick,/pgfplots/every minor tick,/pgfplots/every tick,/pgfplots/every minor y tick]%
+ \fi
+ \fi
+ \fi
+ }%
+ \fi
+ \ifdim\pgfplots@tmpa<\pgfplots@ycoordminTEX
+ \else
+ \ifdim\pgfplots@tmpa>\pgfplots@ycoordmaxTEX
+ \else
+ \ifpgfplots@ymajorgrids
+ \pgfplots@drawyaxis@placecomputedgridline[/pgfplots/every axis grid,/pgfplots/every major grid, /pgfplots/every axis y grid,/pgfplots/every major y grid]%
+ \fi
+ \ifpgfplots@tickshow
+ \ifpgfplots@ymajorticks
+ \pgfplots@drawyaxis@placecomputedtick\pgfplots@tickwidth[/pgfplots/every tick,/pgfplots/every major tick,/pgfplots/every y tick,/pgfplots/every major y tick]%
+ \fi
+ \fi
+ \fi
+ \fi
+ \endscope
+ }%
+ \fi
+ \pgfplots@draw@tick@scale@label@for y%
+ \endgroup
+}
+
+\def\pgfplots@draw@tick@scale@label@for#1{%
+ \csname ifpgfplots@#1islinear\endcsname
+ \ifpgfplots@scaled@ticks
+ \begingroup
+ \xdef\pgfplots@TMP{\csname pgfplots@tick@scale@#1\endcsname}%
+ \expandafter\c@pgf@counta\pgfplots@TMP\relax
+ \multiply\c@pgf@counta by-1
+ \ifnum\c@pgf@counta=0\relax
+ \global\let\pgfplots@TMP=\pgfutil@empty
+ \else
+ \xdef\pgfplots@TMP{\the\c@pgf@counta}%
+ \fi
+ \endgroup
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \edef\pgfplots@tick@scale@labels{\noexpand\pgfplots@invoke@pgfkeyscode{/pgfplots/tick scale label code/.@cmd}{\pgfplots@TMP}}%
+ \node
+ [%
+ xshift=\pgfplots@xcoordminTEX,%
+ yshift=\pgfplots@ycoordminTEX,%
+ x=\pgfplots@xcoordmaxTEX-\pgfplots@xcoordminTEX,%
+ y=\pgfplots@ycoordmaxTEX-\pgfplots@ycoordminTEX,%
+ /pgfplots/every tick label,%
+ /pgfplots/every #1 tick label,%
+ /pgfplots/every #1 tick scale label]
+ {\pgfplots@tick@scale@labels};
+ \fi
+ \fi
+ \fi
+}
+
+% Simply invokes the code of PGF key #1 with value #2, that means
+% #1#2\pgfeov
+\def\pgfplots@invoke@pgfkeyscode#1#2{%
+ \pgfkeysgetvalue{#1}\pgfplots@invoke@pgfkeyscode@CODE
+ \pgfplots@invoke@pgfkeyscode@CODE#2\pgfeov
+}
+
+% Check if it does not cross the y-axis
+\def\pgfplots@xtick@check@tickshow{%
+ \pgfplots@tickshowtrue
+ \ifnum\pgfplots@xaxislinesnum=2\relax
+ \ifcase\pgfplots@yaxislinesnum\relax
+ \ifdim\pgfplots@tmpa=\pgfplots@xcoordminTEX\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \ifdim\pgfplots@tmpa=\pgfplots@xcoordmaxTEX\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \or
+ \ifdim\pgfplots@tmpa=\pgfplots@xcoordminTEX\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \or
+ \ifdim\pgfplots@tmpa=\pgfplots@ZERO@x\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \or
+ \ifdim\pgfplots@tmpa=\pgfplots@xcoordmaxTEX\relax
+ \pgfplots@tickshowfalse
+ \fi
+ \fi
+ \fi
+}
+
+\def\pgfplots@drawxaxis@placecomputedtick#1[#2]{%
+ \ifcase\pgfplots@xtickalignnum\relax
+ \def\pgfplots@xtick@offset{0pt}
+ \or
+ \def\pgfplots@xtick@offset{#1}
+ \or
+ \def\pgfplots@xtick@offset{.5*#1}
+ \fi
+ %\pgfplots@xtick@check@tickshow
+ %\ifpgfplots@tickshow
+ \draw[#2]
+ \ifcase\pgfplots@xtickposnum
+ (\pgfplots@tmpa, \pgfplots@ycoordminTEX-\pgfplots@xtick@offset) -- ++(0pt, #1)
+
+ (\pgfplots@tmpa, \pgfplots@ycoordmaxTEX+\pgfplots@xtick@offset) -- ++(0pt,-#1)
+ \or
+ (\pgfplots@tmpa, \pgfplots@ycoordminTEX-\pgfplots@xtick@offset) -- ++(0pt, #1)
+ \or
+ (\pgfplots@tmpa, \pgfplots@ZERO@y -\pgfplots@xtick@offset) -- ++(0pt, #1)
+ \or
+ (\pgfplots@tmpa, \pgfplots@ycoordmaxTEX+\pgfplots@xtick@offset) -- ++(0pt,-#1)
+ \fi
+ ;
+ %\fi
+}%
+\def\pgfplots@drawxaxis@placecomputedgridline[#1]{%
+ \draw[#1]
+ (\pgfplots@tmpa, \pgfplots@ycoordminTEX\pgfplots@leftover)
+ -- (\pgfplots@tmpa, \pgfplots@ycoordmaxTEX\pgfplots@rightover)
+ ;
+}%
+
+% #1: axis (x or y)
+% #2: tick position list
+\def\pgfplots@draw@extra@ticks@for#1#2{%
+ \begingroup
+ \edef\pgfplots@TMP{#2}%
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \pgfplots@scaled@ticksfalse
+ \csname pgfplots@#1minorticksfalse\endcsname
+ \csname pgfplots@#1minorgridsfalse\endcsname
+ \expandafter\let\expandafter\axis@TMP\csname pgfplots@extra@#1ticklabel\endcsname
+ \expandafter\let\csname pgfplots@#1ticklabel\endcsname=\axis@TMP
+ % FIXME: that search path - thing is far from perfect.
+ % In fact, it doesn't even work for choice keys... with
+ % unexpected results.
+ % I have fixed that in PGF CVS - but PGF 2.0 does not yet work
+ % here!
+ \pgfqkeys{/pgfplots/search path for tikz}{/pgfplots/every extra #1 tick}%
+ \csname pgfplots@draw#1axis\endcsname{#2}%
+ \fi
+ \endgroup
+}
+
+\def\pgfplots@drawaxis@innerlines{%
+ \ifnum\pgfplots@yaxislinesnum=2
+ \draw[decorate,ydiscont,decoration={pre length=\ydisstart, post length=\ydisend}] (\pgfplots@ZERO@x, \pgfplots@ycoordminTEX) -- (\pgfplots@ZERO@x, \pgfplots@ycoordmaxTEX);
+ \fi
+ \ifnum\pgfplots@xaxislinesnum=2
+ \draw[decorate,xdiscont,decoration={pre length=\xdisstart, post length=\xdisend}] (\pgfplots@xcoordminTEX, \pgfplots@ZERO@y) -- (\pgfplots@xcoordmaxTEX, \pgfplots@ZERO@y);
+ \fi
+}%
+
+\def\pgfplots@drawaxis@outerlines{%
+ \draw
+ (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX)
+ \ifcase\pgfplots@yaxislinesnum
+ decorate [ydiscont,decoration={pre length=\ydisstart, post length=\ydisend}] { -- (\pgfplots@xcoordminTEX, \pgfplots@ycoordmaxTEX) }
+ \or decorate [ydiscont,decoration={pre length=\ydisstart, post length=\ydisend}] { -- (\pgfplots@xcoordminTEX, \pgfplots@ycoordmaxTEX) }
+ \or { (\pgfplots@xcoordminTEX, \pgfplots@ycoordmaxTEX) }
+ \or { (\pgfplots@xcoordminTEX, \pgfplots@ycoordmaxTEX) }
+ \fi
+ \ifcase\pgfplots@xaxislinesnum
+ decorate [xdiscont,decoration={pre length=\xdisstart, post length=\xdisend}] { -- (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX) }
+ \or { (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX) }
+ \or { (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX) }
+ \or decorate [xdiscont,decoration={pre length=\xdisstart, post length=\xdisend}] { -- (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX) }
+ \fi
+ \ifcase\pgfplots@yaxislinesnum
+ decorate [ydiscont,decoration={pre length=\ydisend, post length=\ydisstart}] { -- (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordminTEX) }
+ \or { (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordminTEX) }
+ \or { (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordminTEX) }
+ \or decorate [ydiscont,decoration={pre length=\ydisend, post length=\ydisstart}] { -- (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordminTEX) }
+ \fi
+ \ifcase\pgfplots@xaxislinesnum
+ decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}] { -- (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX) }
+ \or decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}] { -- (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX) }
+ \or { (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX) }
+ \or { (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX) }
+ \fi
+ ; % -- cycle;
+}%
+
+\def\pgfplots@drawaxis@lines{%
+ \begingroup
+ \begingroup
+ % this group employs several temporary dimension registers
+ % and is therefor scoped:
+ \let\ydisstart=\pgf@xa
+ \let\ydisend=\pgf@xb
+ \let\xdisstart=\pgf@ya
+ \let\xdisend=\pgf@yb
+ \ydisend=\pgfplots@ycoordmaxTEX
+ \advance \ydisend by -\pgfplots@ycoordminTEX
+ \ifcase\pgfplots@yaxisdiscontnum\relax
+ \let\ydiscontstyle=\pgfutil@empty
+ \or
+ \def\ydiscontstyle{decoration={zigzag,segment length=12pt, amplitude=4pt}}%
+ \advance \ydisend by -16pt
+ \or
+ \def\ydiscontstyle{decoration={ticks,segment length=4pt, amplitude=8pt}}%
+ \advance \ydisend by -8pt
+ \fi
+ \ifpgfplots@apply@datatrafo@y
+ \advance \pgfplots@ycoordmaxTEX by\pgfplots@data@scale@trafo@SHIFT@y pt
+ \fi
+ \ifdim\pgfplots@ycoordmaxTEX<0pt
+ \ydisstart=\ydisend
+ \ydisend=4pt
+ \else
+ \ydisstart=4pt
+ \fi
+ \ifpgfplots@apply@datatrafo@y
+ \advance \pgfplots@ycoordmaxTEX by-\pgfplots@data@scale@trafo@SHIFT@y pt
+ \fi
+ \xdisend=\pgfplots@xcoordmaxTEX
+ \advance \xdisend by -\pgfplots@xcoordminTEX
+ \ifcase\pgfplots@xaxisdiscontnum\relax
+ \let\xdiscontstyle=\pgfutil@empty
+ \or
+ \def\xdiscontstyle{decoration={zigzag,segment length=12pt, amplitude=4pt}}%
+ \advance \xdisend by -16pt
+ \or
+ \def\xdiscontstyle{decoration={ticks,segment length=4pt, amplitude=8pt}}%
+ \advance \xdisend by -8pt
+ \fi
+ \ifpgfplots@apply@datatrafo@x
+ \advance \pgfplots@xcoordmaxTEX by\pgfplots@data@scale@trafo@SHIFT@x pt
+ \fi
+ \ifdim\pgfplots@xcoordmaxTEX<0pt
+ \xdisstart=\xdisend
+ \xdisend=4pt
+ \else
+ \xdisstart=4pt
+ \fi
+ \ifpgfplots@apply@datatrafo@x
+ \advance \pgfplots@xcoordmaxTEX by-\pgfplots@data@scale@trafo@SHIFT@x pt
+ \fi
+ % carry local computations outside of group:
+ \xdef\pgfplots@TMP{%
+ \noexpand\def\noexpand\xdisstart{\the\xdisstart}%
+ \noexpand\def\noexpand\xdisend{\the\xdisend}%
+ \noexpand\def\noexpand\ydisstart{\the\ydisstart}%
+ \noexpand\def\noexpand\ydisend{\the\ydisend}%
+ \noexpand\pgfkeys{%
+ /tikz/xdiscont/.style={\xdiscontstyle},%
+ /tikz/ydiscont/.style={\ydiscontstyle}}%
+ }%
+ \endgroup
+ \pgfplots@TMP
+ \pgfplots@drawaxis@outerlines%
+ \pgfplots@drawaxis@innerlines%
+ \endgroup
+}%
+
+% X-Achsen und Achsenbeschriftung
+% 1: Ticks
+\def\pgfplots@drawxaxis#1{%
+ \ifpgfplots@xislinear
+ \ifpgfplots@scaled@ticks
+ \pgfplots@init@scaled@tick@for{x}%
+ \fi
+ \fi
+ \begingroup
+ \global\pgfplots@ticknum=0
+ \edef\pgfplots@TMP{#1}%
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \ifpgfplots@xminorticks
+ \pgfplots@needsminorlooptrue
+ \fi
+ \ifpgfplots@xminorgrids
+ \pgfplots@needsminorlooptrue
+ \fi
+ \ifpgfplots@needsminorloop
+ \ifpgfplots@xislinear
+ \begingroup
+ \c@pgf@counta=\pgfplots@minor@xtick@num\relax
+ \advance\c@pgf@counta by1\relax
+ \pgfplots@tmpb=\pgfplots@tick@distance@x pt
+ \divide\pgfplots@tmpb by\c@pgf@counta
+ \edef\pgfmathresult{\pgf@sys@tonumber{\pgfplots@tmpb}}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ \let\pgfplots@minor@tick@dist=\pgfmathresult
+ \else
+ \def\pgfplots@minor@xtick@num{9}%
+ \fi
+ \fi
+ \xdef\pgfplots@show@ticklabel@LASTTICK{}%
+ \foreach \x in {#1} {
+ \pgfextractx{\pgfplots@tmpa}{\pgfpointxy{\x}{0}}%
+ \pgfplots@xtick@check@tickshow
+ %
+ \ifpgfplots@tickshow
+ \ifdim\pgfplots@tmpa<\pgfplots@xcoordminTEX
+ \else
+ \ifdim\pgfplots@tmpa>\pgfplots@xcoordmaxTEX
+ \else
+ \ifcase\pgfplots@xtickalignnum\relax
+ \def\pgfplots@xtick@offset{0pt}
+ \or
+ \def\pgfplots@xtick@offset{\pgfplots@tickwidth}
+ \or
+ \def\pgfplots@xtick@offset{.5*\pgfplots@tickwidth}
+ \fi
+ \ifcase\pgfplots@xtickposnum
+ \def\pgfplots@xtick@origin{\pgfplots@ycoordminTEX}
+ \or
+ \def\pgfplots@xtick@origin{\pgfplots@ycoordminTEX}
+ \or
+ \def\pgfplots@xtick@origin{\pgfplots@ZERO@y}
+ \or
+ \def\pgfplots@xtick@origin{\pgfplots@ycoordmaxTEX}
+ \fi
+ % Axis tick labels:
+ \ifnum\pgfplots@xtickposnum=3
+ \pgfplots@show@ticklabel
+ [above,/pgfplots/every tick label,/pgfplots/every x tick label]%
+ {x}{\x}(\pgfplots@tmpa,\pgfplots@xtick@origin+\pgfplots@xtick@offset)%
+ {\pgfplots@ticknum}%
+ \else
+ \pgfplots@show@ticklabel
+ [below,/pgfplots/every tick label,/pgfplots/every x tick label]%
+ {x}{\x}(\pgfplots@tmpa,\pgfplots@xtick@origin-\pgfplots@xtick@offset)%
+ {\pgfplots@ticknum}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \global\advance\pgfplots@ticknum by1
+ %
+ \scope
+ %\clip (\pgfplots@xcoordminTEX\pgfplots@leftover, \pgfplots@ycoordminTEX\pgfplots@leftover)
+ % rectangle (\pgfplots@xcoordmaxTEX\pgfplots@rightover, \pgfplots@ycoordmaxTEX\pgfplots@rightover);
+ \pgfinterruptboundingbox%
+ \clip (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX-5cm)
+ rectangle (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX+5cm);
+ \endpgfinterruptboundingbox%
+ % X-Axis ticks bottom and top
+ % in log:
+ % log( i*10^k ) = log\i + k\log10 -> draw ticks for i=1..9
+ \ifpgfplots@needsminorloop
+ \foreach \i in {1,...,\pgfplots@minor@xtick@num} {
+ % \pgfextractx{\pgfplots@tmpb}{\pgfpointxy{\logi\i}{0}}%
+ \ifpgfplots@xislinear
+ \pgfextractx{\pgfplots@tmpb}{\pgfpointxy{\i*\pgfplots@minor@tick@dist}{0}}%
+ \else
+ \pgfextractx{\pgfplots@tmpb}{\pgfpointxy{\logi\i}{0}}%
+ \fi
+ \advance\pgfplots@tmpa by\pgfplots@tmpb
+ \ifdim\pgfplots@tmpa<\pgfplots@xcoordminTEX
+ \else
+ \ifdim\pgfplots@tmpa>\pgfplots@xcoordmaxTEX
+ \else
+ \ifpgfplots@xminorgrids
+ \pgfplots@drawxaxis@placecomputedgridline[/pgfplots/every axis grid,/pgfplots/every minor grid]%
+ \fi
+ \ifpgfplots@xminorticks
+ \pgfplots@drawxaxis@placecomputedtick\pgfplots@subtickwidth[/pgfplots/every tick,/pgfplots/every minor tick,/pgfplots/every x tick,/pgfplots/every minor x tick]%
+ \fi
+ \fi
+ \fi
+ }%
+ \fi
+ \ifdim\pgfplots@tmpa<\pgfplots@xcoordminTEX
+ \else
+ \ifdim\pgfplots@tmpa>\pgfplots@xcoordmaxTEX
+ \else
+ \ifpgfplots@xmajorgrids
+ \pgfplots@drawxaxis@placecomputedgridline[/pgfplots/every axis grid,/pgfplots/every major grid,/pgfplots/every axis x grid,/pgfplots/every major x grid]%
+ \fi
+ \ifpgfplots@tickshow
+ \ifpgfplots@xmajorticks
+ \pgfplots@drawxaxis@placecomputedtick\pgfplots@tickwidth[/pgfplots/every tick,/pgfplots/every major tick, /pgfplots/every x tick,/pgfplots/every major x tick]%
+ \fi
+ \fi
+ \fi
+ \fi
+ \endscope
+ }%
+ \fi
+ \pgfplots@draw@tick@scale@label@for x%
+ \endgroup
+}
+
+\def\pgfplots@rememberplotspec#1{%
+ \begingroup
+ \globaldefs=1
+ \pgfplotslistpushback#1\to\pgfplots@plotspeclist
+ \endgroup
+}
+
+\def\pgfplots@getautoplotspec into#1{%
+ \pgfplotslistsize\autoplotspeclist\to\c@pgf@counta
+ \ifnum\c@pgf@counta=0
+ \let#1=\pgfutil@empty
+ \else
+ \c@pgf@countb=\pgfplots@numplots
+ % offset modulo size:
+ \loop
+ \ifnum\c@pgf@countb<\c@pgf@counta
+ \pgfplots@loop@CONTINUEfalse
+ \else
+ \pgfplots@loop@CONTINUEtrue
+ \fi
+ \ifpgfplots@loop@CONTINUE
+ \advance\c@pgf@countb by-\c@pgf@counta
+ \repeat
+ \pgfplotslistselect\c@pgf@countb\of\autoplotspeclist\to#1
+%\pgfplots@message{pgfplots.sty: using \string\autoplotspeclist\ specification no\#\the\c@pgf@countb (of \the\c@pgf@counta): #1}%
+ \fi
+}
+
+% The main interface to draw a plot into an axis.
+%
+% Usage:
+% \addplot
+% plot coordinates {
+% (0,0)
+% (1,1)
+% };
+%
+% or
+%
+% \addplot[color=blue,mark=*]
+% plot coordinates {
+% (0,0)
+% (1,1)
+% };
+%
+% The first syntax will use the next plot specification in the list
+% \autoplotspeclist
+% and the first will use blue color and * markers.
+%
+% The linespec. will be used in the legend.
+%
+% Low-level implementation:
+%
+% \pgfplots@addplot
+% \pgfplots@addplotimpl
+% \pgfplots@start@plot@with@options <--- \begingroup
+% ...
+% ... remember options GLOBALLY
+% ... update limits GLOBALLY
+% ... \pgfplots@addplot@enqueue@coords GLOBALLY
+% ...
+% \pgfplots@end@plot <--- \endgroup
+\long\def\pgfplots@addplot{%
+ \pgfutil@ifnextchar+{%
+ \pgfplots@getautoplotspec into\nextplotspec
+ \pgfplots@addplotimplAPPEND
+ }{%
+ \pgfutil@ifnextchar[{%
+ \pgfplots@addplotimpl%
+ }{%
+ \pgfplots@getautoplotspec into\nextplotspec
+ % the space after ']' is required here:
+ % FIXME:
+ % - \addplot[]plot coordinates is NOT allowed!?
+ \expandafter\pgfplots@addplotimpl\expandafter[\nextplotspec]
+ }%
+ }%
+}
+
+\long\def\pgfplots@addplotimplAPPEND+[{%
+ \expandafter\pgfplots@addplotimpl\expandafter[\nextplotspec,
+}
+
+\long\def\pgfplots@addplotimpl[#1]{%
+ \pgfutil@ifnextchar p{%
+ \pgfplots@addplotimpl@plot{#1}%
+ }{%
+ \pgfplots@addplotimpl@plot{#1}plot
+ }%
+}
+
+\def\pgfplots@addplotimpl@plot#1plot{%
+ \pgfutil@ifnextchar[{%
+ \pgfplots@addplotimpl@plot@withoptions{#1}%
+ }{%
+ \pgfplots@addplotimpl@plot@withoptions{#1}[]%
+ }%
+}
+
+\def\pgfplots@addplotimpl@plot@withoptions#1[#2]{
+ \pgfplots@start@plot@with@options{#1}{#2}%
+ \pgfutil@ifnextchar c{%
+ \pgfplots@addplotimpl@coordinates{#1}plot
+ }{%
+ \pgfutil@ifnextchar f{%
+ \pgfplots@addplotimpl@f{#1}%
+ }{%
+ \pgfutil@ifnextchar t{%
+ \pgfplots@addplotimpl@table{#1}%
+ }{%
+ \pgfutil@ifnextchar ({%
+ \pgfplots@addplotimpl@expression{#1}%
+ }{%
+ \pgfplots@error{Sorry, the supplied plot command is unknown or unsupported by pgfplots!}%
+ }%
+ }%
+ }%
+ }%
+}
+
+% Currently, plot expression is really inefficient:
+%
+% 1. it invokes the math parser to get all coordinates. Ok, that's
+% what one expects.
+%
+% 2. It collects the result into one large list instead of calling
+% pgfplots' stream methods. That's because \foreach encapsulates its
+% code in at least one TeX-group.
+%
+% 3. It processes the collected list; applying any floating point
+% parser routines - it does NOT know that any numbers are already in
+% TeX-precision!
+%
+% FIXME : configure pgfplots to finish the data scaling trafo! It's
+% perfectly ok if it is simply the identity!
+\long\def\pgfplots@addplotimpl@expression#1(#2,#3)#4;{%
+ \pgfplots@PREPARE@COORD@STREAM{#1}{#4}%
+ \edef\pgfplots@plot@data{\noexpand\foreach\expandafter\noexpand\tikz@plot@var in {\tikz@plot@samplesat}}%
+ \global\let\pgfplots@TMP=\pgfutil@empty
+ \pgfplots@plot@data{%
+ \pgfmathparse{#2}%
+ \let\pgfplots@current@point@x=\pgfmathresult
+ \pgfmathparse{#3}%
+ \let\pgfplots@current@point@y=\pgfmathresult
+ \pgfplots@toka=\expandafter{\pgfplots@TMP}%
+ \xdef\pgfplots@TMP{\the\pgfplots@toka(\pgfplots@current@point@x,\pgfplots@current@point@y)}%
+ }%
+ \expandafter\pgfplots@coord@stream@foreach\expandafter{\pgfplots@TMP}%
+}%
+
+\def\pgfplots@addplotimpl@expression@limits#1{%
+ %--------------------------------------------------
+ %FIXME
+ % \pgfkeysinstallkeyfilter{/pgf/key filters/equals}{/tikz/domain}%
+ % \pgfkeysinstallkeyfilterhandler{/pgf/key filter handlers/ignore}%
+ % \pgfqkeysfiltered
+ % {/tikz}%
+ % {#1}%
+ %--------------------------------------------------
+ \expandafter\pgfplots@addplotimpl@expression@limits@domain\tikz@plot@domain\relax
+}%
+
+\def\pgfplots@addplotimpl@expression@limits@domain#1:#2\relax{%
+ \ifpgfplots@autocompute@xlim
+ \ifpgfplots@float@numerics@mode@x
+ \pgfmathfloatparsenumber{#1}%
+ \let\pgfplots@current@point@x=\pgfmathresult
+ \pgfmathfloatmin{\pgfplots@xmin}{\pgfplots@current@point@x}%
+ \global\let\pgfplots@xmin=\pgfmathresult
+ \pgfmathfloatmax{\pgfplots@xmax}{\pgfplots@current@point@x}%
+ \global\let\pgfplots@xmax=\pgfmathresult
+ %
+ \pgfmathfloatparsenumber{#2}%
+ \let\pgfplots@current@point@x=\pgfmathresult
+ \pgfmathfloatmin{\pgfplots@xmin}{\pgfplots@current@point@x}%
+ \global\let\pgfplots@xmin=\pgfmathresult
+ \pgfmathfloatmax{\pgfplots@xmax}{\pgfplots@current@point@x}%
+ \global\let\pgfplots@xmax=\pgfmathresult
+ \else
+ \pgfmathmin{\pgfplots@xmin}{#1}%
+ \global\let\pgfplots@xmin=\pgfmathresult
+ \pgfmathmax{\pgfplots@xmax}{#1}%
+ \global\let\pgfplots@xmax=\pgfmathresult
+ \pgfmathmin{\pgfplots@xmin}{#2}%
+ \global\let\pgfplots@xmin=\pgfmathresult
+ \pgfmathmax{\pgfplots@xmax}{#2}%
+ \global\let\pgfplots@xmax=\pgfmathresult
+ \fi
+ \fi
+}
+
+\def\pgfplots@addplotimpl@f#1f{%
+ \pgfutil@ifnextchar i{\pgfplots@addplotimpl@file{#1}}{\pgfplots@addplotimpl@function{#1}}%
+}%
+
+\let\pgfplots@backupof@pgfplotxyfile=\pgfplotxyfile
+
+% #1: args of \addplot[...]
+% #2: file name
+% #3: trailing path commands until ';'
+\def\pgfplots@addplotimpl@function#1unction#2#3;{%
+ \def\tikz@plot@filename{\tikz@plot@prefix\tikz@plot@id}%
+ \iftikz@plot@raw@gnuplot%
+ \def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{#2}}%
+ \else%
+ \iftikz@plot@parametric%
+ \def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{%
+ set format "\%.7e";
+ set samples \tikz@plot@samples;
+ set parametric;
+ plot [t=\tikz@plot@domain] #2}}%
+ \else%
+ \def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{%
+ set format "\%.7e";
+ set samples \tikz@plot@samples;
+ plot [x=\tikz@plot@domain] #2}}%
+ \fi%
+ \fi%
+ \def\pgfplotxyfile{\pgfplots@addplotimpl@gnuplotresult{#1}{#3}}%
+ \tikz@plot@data
+ \let\pgfplotxyfile=\pgfplots@backupof@pgfplotxyfile
+}%
+
+\def\pgfplots@addplotimpl@gnuplotresult#1#2#3{%
+ \begingroup
+ \openin1=#3
+ \ifeof1
+ \pgfplots@error{Sorry, the gnuplot-result file '#3' could not be found. Maybe you need to enable the shell-escape feature? For pdflatex, this is '>> pdflatex -shell-escape'. You can also invoke '>> gnuplot #3' manually.}%
+ \aftergroup\pgfplots@loop@CONTINUEfalse
+ \else
+ \aftergroup\pgfplots@loop@CONTINUEtrue
+ \fi
+ \closein1
+ \endgroup
+ \ifpgfplots@loop@CONTINUE
+ \pgfplots@addplotimpl@file{#1}ile{#3}#2;%
+ \fi
+}
+
+\def\pgfplots@addplotimpl@file#1ile{%
+ \pgfplots@addplotimpl@table{#1}table[x index=0,y index=1,header=false]%
+}%
+
+\def\pgfplots@addplotimpl@table#1table{%
+ \pgfutil@ifnextchar[{%
+ \pgfplots@addplotimpl@table@getopts{#1}%
+ }{%
+ \pgfplots@addplotimpl@table@getopts{#1}[x index=0,y index=1]%
+ }%
+}%
+
+\def\pgfplots@addplotimpl@table@f#1#2from{%
+ \pgfplots@addplot@table@from@macrotrue
+ \pgfplots@addplotimpl@table@START{#1}{#2}%
+}
+
+\def\pgfplots@addplotimpl@table@getopts#1[#2]{%
+ \pgfutil@ifnextchar f{%
+ \pgfplots@addplotimpl@table@f{#1}{#2}%
+ }{%
+ \pgfplots@addplot@table@from@macrofalse
+ \pgfplots@addplotimpl@table@START{#1}{#2}%
+ }%
+}
+
+% #1: arguments to \addplot[...]
+% #2: arguments to table[...]
+% #3: the argument of plot table{...}
+% #4: trailing path arguments after plot table{...}#4;
+\long\def\pgfplots@addplotimpl@table@START#1#2#3#4;{%
+ \begingroup
+ \pgfplotstableset{#2}%
+ \ifpgfplots@addplot@table@from@macro
+ \pgfplotstablecopy#3\to\pgfplots@table
+ \else
+ \pgfplotstableread{#3} to \pgfplots@table
+ \fi
+ \ifx\pgfplots@plot@tbl@x\pgfutil@empty
+ \pgfplotstablegetcolumnbyindex\pgfplots@plot@tbl@xindex\of\pgfplots@table\to\addplot@tbl@x
+ \else
+ \pgfplotstablegetcolumnbyname\pgfplots@plot@tbl@x\of\pgfplots@table\to\addplot@tbl@x
+ \fi
+ \ifx\pgfplots@plot@tbl@y\pgfutil@empty
+ \pgfplotstablegetcolumnbyindex\pgfplots@plot@tbl@yindex\of\pgfplots@table\to\addplot@tbl@y
+ \else
+ \pgfplotstablegetcolumnbyname\pgfplots@plot@tbl@y\of\pgfplots@table\to\addplot@tbl@y
+ \fi
+ %
+ \ifpgfplots@errorbars@enabled
+ \let\addplot@tbl@error@x=\pgfutil@empty
+ \let\addplot@tbl@error@y=\pgfutil@empty
+ \pgfkeysgetvalue{/pgfplots/table/x error index}\pgfplots@plot@tbl@error@xindex
+ \pgfkeysgetvalue{/pgfplots/table/x error}\pgfplots@plot@tbl@error@x
+ \pgfkeysgetvalue{/pgfplots/table/y error index}\pgfplots@plot@tbl@error@yindex
+ \pgfkeysgetvalue{/pgfplots/table/y error}\pgfplots@plot@tbl@error@y
+ \ifx\pgfplots@plot@tbl@error@x\pgfutil@empty
+ \ifx\pgfplots@plot@tbl@error@xindex\pgfutil@empty
+ \else
+ \pgfplotstablegetcolumnbyindex\pgfplots@plot@tbl@error@xindex\of\pgfplots@table\to\addplot@tbl@error@x
+ \fi
+ \else
+ \pgfplotstablegetcolumnbyname\pgfplots@plot@tbl@error@x\of\pgfplots@table\to\addplot@tbl@error@x
+ \fi
+ \ifx\pgfplots@plot@tbl@error@y\pgfutil@empty
+ \ifx\pgfplots@plot@tbl@error@yindex\pgfutil@empty
+ \else
+ \pgfplotstablegetcolumnbyindex\pgfplots@plot@tbl@error@yindex\of\pgfplots@table\to\addplot@tbl@error@y
+ \fi
+ \else
+ \pgfplotstablegetcolumnbyname\pgfplots@plot@tbl@error@y\of\pgfplots@table\to\addplot@tbl@error@y
+ \fi
+ \fi
+ %
+ \pgfplots@PREPARE@COORD@STREAM{#1}{#4}%
+ \pgfplots@coord@stream@start
+ \loop
+ \pgfplotslistcheckempty\addplot@tbl@x
+ \ifpgfplotslistempty
+ \pgfplots@loop@CONTINUEfalse
+ \else
+ \pgfplots@loop@CONTINUEtrue
+ \fi
+ \ifpgfplots@loop@CONTINUE
+ \pgfplotslistpopfront\addplot@tbl@x\to\addplot@tbl@cur@x
+ \pgfplotslistpopfront\addplot@tbl@y\to\addplot@tbl@cur@y
+ \ifpgfplots@errorbars@enabled
+ \ifx\addplot@tbl@error@x\pgfutil@empty
+ \let\addplot@tbl@error@cur@x=\pgfutil@empty
+ \else
+ \pgfplotslistpopfront\addplot@tbl@error@x\to\addplot@tbl@error@cur@x
+ \fi
+ \ifx\addplot@tbl@error@y\pgfutil@empty
+ \let\addplot@tbl@error@cur@y=\pgfutil@empty
+ \else
+ \pgfplotslistpopfront\addplot@tbl@error@y\to\addplot@tbl@error@cur@y
+ \fi
+ \edef\pgfplots@TMP{{\addplot@tbl@cur@x}{\addplot@tbl@cur@y}{\addplot@tbl@error@cur@x}{\addplot@tbl@error@cur@y}}%
+ \expandafter\pgfplots@coord@stream@coord\pgfplots@TMP
+ \else
+ \edef\pgfplots@TMP{{\addplot@tbl@cur@x}{\addplot@tbl@cur@y}{}{}}%
+ \expandafter\pgfplots@coord@stream@coord\pgfplots@TMP
+ \fi
+ \repeat
+ \pgfplots@coord@stream@end
+ \endgroup
+}
+
+% #1: arguments to \addplot[] (these are used for legend images as well)
+% #2: arguments to \addplot plot[] (these are set directly in \addplot)
+\def\pgfplots@start@plot@with@options#1#2{%
+ \begingroup
+ \def\pgfplots@current@point@coordindex{0}% can be used inside of coordinate filters.
+ \def\coordindex{\pgfplots@current@point@coordindex}% valid inside of \addplot
+ \ifx\pgfplots@execute@at@begin@plot\pgfutil@empty
+ \else
+ \pgfplots@execute@at@begin@plot
+ \fi
+ \ifpgfplots@stackedmode
+ \pgfplots@stacked@beginplot
+ \fi
+ \pgfplots@rememberplotspec{#1}%
+ \def\pgfplots@addplot@nonlegend@options{#2}%
+ \ifx\pgfplots@addplot@nonlegend@options\pgfutil@empty
+ \else
+ \pgfqkeys{/tikz}{#2}%
+ \fi
+}
+
+% Initialises
+% \pgfplots@coord@stream@start
+% \pgfplots@coord@stream@coord
+% \pgfplots@coord@stream@end
+% such that a following coordinate stream is processed properly. The
+% following coordinate stream may come from different input methods.
+%
+% Arguments:
+% #1: all options of \addplot[...] (the plot style)
+% #2: any trailing path commands after the 'plot' command as such,
+% for example \addplot plot coordinates {...} -- (0,0);
+% would yield #2 =' -- (0,0)'
+%
+\long\def\pgfplots@PREPARE@COORD@STREAM#1#2{%
+ \ifpgfplots@errorbars@enabled
+ \pgfplots@streamerrorbar@recordto{\pgfplots@recordederrorbar}%
+ \pgfplots@streamerrorbarstart
+ \else
+ \let\pgfplots@recordederrorbar=\pgfutil@empty
+ \fi
+ \pgfplots@coord@stream@INIT\pgfplots@coord@stream@recorded
+ %
+ % make sure that \pgfplots@coord@stream@end@@ is called at the end
+ % of the lately prepare end-stream method.
+ \expandafter\def\expandafter\pgfplots@coord@stream@end@\expandafter{%
+ \pgfplots@coord@stream@end@
+ \pgfplots@coord@stream@end@@
+ \pgfplots@end@plot
+ }%
+ \def\pgfplots@coord@stream@end@@{%
+ \ifpgfplots@errorbars@enabled
+ \pgfplots@streamerrorbarend
+ \fi
+ % Idea: use
+ % \scope[plot specification]
+ % <any paths for error bars>
+ % \endscope
+ % \draw plot coordinates {...};
+ % to share plot specifications between error bars and plot
+ % coordinates. Unfortunately, it is NOT sufficient to use
+ % \tikzset{#1}
+ \edef\pgfplots@TMP{/pgfplots/every axis plot,/pgfplots/every axis plot no \the\pgfplots@numplots/.try}%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@TMP,#1,/pgfplots/every axis plot post}%
+ % Assemble a
+ % \pgfplots@addplot@enqueue@coords{}{}...{}
+ % statement with correct arguments:
+ \ifx\pgfplots@recordederrorbar\pgfutil@empty
+ \let\pgfplots@TMPB=\pgfutil@empty%
+ \else
+ \pgfplotslist@TOK@b=\expandafter{\pgfplots@recordederrorbar}%
+ \def\pgfplots@TMPB{%
+ \noexpand\pgfplots@errorbars@finishwithstyleoptions[\the\pgfplotslist@TOK@a]{\the\pgfplotslist@TOK@b}%
+ }%
+ \fi
+ \ifpgfplots@datascaletrafo@initialised
+ \pgfplots@addplot@get@named@startendpoints@command\pgfplots@TMP
+ \pgfplots@toka=\expandafter{\pgfplots@TMP}%
+ \else
+ \pgfplots@toka={}%
+ \fi
+ \edef\pgfplots@TMP{%
+ \noexpand\pgfplots@addplot@enqueue@coords
+ {
+ \noexpand\def\noexpand\plotnum{\the\pgfplots@numplots}%
+ \noexpand\pgfplots@initzerolevelhandler
+ \the\pgfplots@toka% named start/end points
+ \noexpand\tikzstyle{current plot style}=[\the\pgfplotslist@TOK@a]%
+ \pgfplots@TMPB% error bar commands
+ }%
+ {%
+ \noexpand\draw[current plot style]%
+ }%
+ }%
+ \expandafter\pgfplots@TMP\expandafter{\pgfplots@coord@stream@recorded #2;}%
+ {}%
+ }%
+}%
+
+\def\pgfplots@end@plot{%
+ \global\advance\pgfplots@numplots by1\relax%
+ \ifpgfplots@stackedmode
+ \pgfplots@stacked@endplot
+ \fi
+ \ifx\pgfplots@execute@at@end@plot\pgfutil@empty
+ \else
+ \pgfplots@execute@at@end@plot
+ \fi
+ \global\let\pgfplots@TMP=\relax
+ \ifpgfplots@collect@firstplot@astick
+ \ifnum\pgfplots@numplots=1\relax
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@firstplot@coords@x}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplots@firstplot@coords@y}%
+ \xdef\pgfplots@TMP{%
+ \noexpand\def\noexpand\pgfplots@firstplot@coords@x{\the\pgfplotslist@TOK@a}%
+ \noexpand\def\noexpand\pgfplots@firstplot@coords@y{\the\pgfplotslist@TOK@b}%
+ }%
+ \fi
+ \fi
+ \endgroup
+ \pgfplots@TMP% see above
+}
+
+% #1: arguments to \addplot[...]
+% #2: the plot coordinates
+% #3: any trailing path command before the final ';'. It will be used as-is.
+\long\def\pgfplots@addplotimpl@coordinates#1plot coordinates#2#3;{%
+%\tracingmacros=2\tracingcommands=2
+%\pgfplots@message{processing plots coords with trailing path '#3'}%
+ \pgfplots@PREPARE@COORD@STREAM{#1}{#3}%
+ \pgfplots@coord@stream@foreach{#2}%
+}%
+
+\newif\ifpgfplots@update@limits@for@one@point@ISCLIPPED
+\def\pgfplots@math@ONE{1.0}%
+
+\def\pgfplots@streamerrorbarstart{%
+}%
+\def\pgfplots@streamerrorbarend{%
+}%
+\def\pgfplots@streamerrorbarcoords#1#2{%
+}%
+
+\def\pgfplots@streamerrorbar@recordto#1{%
+ \def\pgfplots@streamerrorbarstart{\let#1=\pgfutil@empty}%
+ \def\pgfplots@streamerrorbarend{}%
+ \def\pgfplots@streamerrorbarcoords##1##2{%
+ \expandafter\def\expandafter#1\expandafter{#1%
+ \pgfplots@errorbar@draw{##1}{##2}%
+ }%
+ }%
+}
+\def\pgfplots@streamerrorbar@directdraw{%
+ \def\pgfplots@streamerrorbarstart{}%
+ \def\pgfplots@streamerrorbarend{}%
+ \def\pgfplots@streamerrorbarcoords##1##2{%
+ \pgfplots@errorbar@draw{##1}{##2}%
+ }%
+}
+
+
+
+% Updates the current x and y limits for point (#1,#2).
+%
+% The point coordinates may be given in floating point format, see
+% below.
+%
+% Please note that if user specified limits are given, automatic
+% limits are only applied to points which fall into the user specified
+% clipping region.
+%
+% PRECONDITIONS:
+% - 'floating point numerics active'
+% => coordinate filtering is active
+% => #1 and/or #2 are in floating point format
+% - no coordinate filters active
+% => #1 and #2 MAY be macros, but they must be valid TeX
+% length (without unit).
+% #3= error for x coord (or empty)
+% #4= error for y coord (or empty)
+\long\def\pgfplots@update@limits@for@one@point#1#2#3#4{%
+%\tracingmacros=2\tracingcommands=2
+%\pgfplots@message{Updating limits for (#1,#2) ...}%
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDfalse
+ \ifpgfplots@clip@limits
+ \ifpgfplots@autocompute@xlim
+ \else
+ \ifpgfplots@float@numerics@mode@x
+ \pgfmathfloatlessthan@{#1}{\pgfplots@xmin}%
+ \ifpgfmathfloatcomparison
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue
+ \fi
+ \pgfmathfloatlessthan@{\pgfplots@xmax}{#1}%
+ \ifpgfmathfloatcomparison
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue
+ \fi
+ \else
+ \pgfmathlessthan@{#1}{\pgfplots@xmin}%
+ \ifx\pgfmathresult\pgfplots@math@ONE
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue
+ \fi
+ \pgfmathlessthan@{\pgfplots@xmax}{#1}%
+ \ifx\pgfmathresult\pgfplots@math@ONE
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue
+ \fi
+ \fi
+ \fi
+ \ifpgfplots@autocompute@ylim
+ \else
+ \ifpgfplots@float@numerics@mode@y
+ \pgfmathfloatlessthan@{#2}{\pgfplots@ymin}%
+ \ifpgfmathfloatcomparison
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue
+ \fi
+ \pgfmathfloatlessthan@{\pgfplots@ymax}{#2}%
+ \ifpgfmathfloatcomparison
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue
+ \fi
+ \else
+ \pgfmathlessthan@{#2}{\pgfplots@ymin}%
+ \ifx\pgfmathresult\pgfplots@math@ONE
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue
+ \fi
+ \pgfmathlessthan@{\pgfplots@ymax}{#2}%
+ \ifx\pgfmathresult\pgfplots@math@ONE
+ \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifpgfplots@update@limits@for@one@point@ISCLIPPED
+ \else
+ \ifpgfplots@autocompute@xlim
+ \ifpgfplots@float@numerics@mode@x
+ \pgfmathfloatmin@{\pgfplots@xmin}{#1}%
+ \global\let\pgfplots@xmin=\pgfmathresult
+ \pgfmathfloatmax@{\pgfplots@xmax}{#1}%
+ \global\let\pgfplots@xmax=\pgfmathresult
+ \else
+ \pgfmathmin@{\pgfplots@xmin}{#1}%
+ \global\let\pgfplots@xmin=\pgfmathresult
+ \pgfmathmax@{\pgfplots@xmax}{#1}%
+ \global\let\pgfplots@xmax=\pgfmathresult
+ \fi
+ \fi
+ \ifpgfplots@autocompute@ylim
+ \ifpgfplots@float@numerics@mode@y
+ \pgfmathfloatmin@{\pgfplots@ymin}{#2}%
+ \global\let\pgfplots@ymin=\pgfmathresult
+ \pgfmathfloatmax@{\pgfplots@ymax}{#2}%
+ \global\let\pgfplots@ymax=\pgfmathresult
+ \else
+ \pgfmathmin@{\pgfplots@ymin}{#2}%
+ \global\let\pgfplots@ymin=\pgfmathresult
+ \pgfmathmax@{\pgfplots@ymax}{#2}%
+ \global\let\pgfplots@ymax=\pgfmathresult
+ \fi
+ \fi
+ \global\pgfplots@limits@are@computedtrue
+ \fi
+%\pgfplots@message{Updated limits: (\pgfplots@xmin,\pgfplots@ymin) rectangle (\pgfplots@xmax,\pgfplots@ymax).}%
+%\tracingmacros=0\tracingcommands=0
+}
+
+\def\pgfplots@invoke@filter#1#2{%
+ \pgfkeysvalueof{/pgfplots/#2 filter/.@cmd}#1\pgfeov%
+}%
+
+% #3= error for x coord (or empty)
+% #4= error for y coord (or empty)
+\def\pgfplots@process@one@point#1#2#3#4{%
+ \pgfplots@prepare@xcoord{#1}%
+ \expandafter\pgfplots@invoke@filter\expandafter{\pgfmathresult}{x}%
+ \let\pgfplots@current@point@x=\pgfmathresult
+ %
+ \pgfplots@prepare@ycoord{#2}%
+ \expandafter\pgfplots@invoke@filter\expandafter{\pgfmathresult}{y}%
+ \let\pgfplots@current@point@y=\pgfmathresult
+ %
+ \ifx\pgfplots@current@point@x\pgfutil@empty
+ \ifpgfplots@warn@for@filter@discards
+ \pgfplots@message{NOTE: coordinate (#1,#2) has been dropped because of the x-coordinate filter.}%
+ \fi
+ \else
+ \ifx\pgfplots@current@point@y\pgfutil@empty
+ \ifpgfplots@warn@for@filter@discards
+ \pgfplots@message{NOTE: coordinate (#1,#2) has been dropped because of the y-coordinate filter.}%
+ \fi
+ \else
+ \ifpgfplots@apply@datatrafo
+ \ifpgfplots@apply@datatrafo@x
+ \pgfmathfloatparsenumber{\pgfplots@current@point@x}%
+ \let\pgfplots@current@point@x=\pgfmathresult
+ \fi
+ \ifpgfplots@apply@datatrafo@y
+ \pgfmathfloatparsenumber{\pgfplots@current@point@y}%
+ \let\pgfplots@current@point@y=\pgfmathresult
+ \fi
+ \ifpgfplots@datascaletrafo@initialised
+ % apply data transformation directly.
+ \ifpgfplots@apply@datatrafo@x
+ \pgfplots@datascaletrafo@x\pgfplots@current@point@x
+ \let\pgfplots@current@point@x=\pgfmathresult
+ \fi
+ \ifpgfplots@apply@datatrafo@y
+ \pgfplots@datascaletrafo@y\pgfplots@current@point@y
+ \let\pgfplots@current@point@y=\pgfmathresult
+ \fi
+ \fi
+ \fi
+ % All following routines (limit updating/stacking/error
+ % bars) will use float numerics if necessary (controlled
+ % by ifs).
+ \ifpgfplots@stackedmode
+ \pgfplots@stacked@preparepoint@inmacro{\pgfplots@current@point@x}{\pgfplots@current@point@y}%
+ \ifpgfplots@datascaletrafo@initialised% is also true if there is no scale trafo.
+ \pgfplots@stacked@finishpoint{\pgfplots@current@point@x}{\pgfplots@current@point@y}%
+ \fi
+ \fi
+ \ifpgfplots@autocomputelimits
+ % update also axis limits:
+ \pgfplots@update@limits@for@one@point{\pgfplots@current@point@x}{\pgfplots@current@point@y}{}{}%
+ \fi
+ \ifpgfplots@errorbars@enabled
+ \pgfplots@process@errorbar@for{\pgfplots@current@point@x}{\pgfplots@current@point@y}{#3}{#4}{#1}{#2}%
+ \fi
+ \pgfplots@toka=\expandafter{\pgfplots@coord@stream@recorded}%
+ \edef\pgfplots@coord@stream@recorded{\the\pgfplots@toka (\pgfplots@current@point@x,\pgfplots@current@point@y)}%
+ \ifpgfplots@collect@firstplot@astick
+ \ifnum\pgfplots@numplots=0
+ \ifx\pgfplots@firstplot@coords@x\pgfutil@empty
+ \pgfplots@toka=\expandafter{}%
+ \else
+ \pgfplots@toka=\expandafter{\pgfplots@firstplot@coords@x,}%
+ \fi
+ \edef\pgfplots@firstplot@coords@x{\the\pgfplots@toka\pgfplots@current@point@x}%
+ \ifx\pgfplots@firstplot@coords@y\pgfutil@empty
+ \pgfplots@toka=\expandafter{}%
+ \else
+ \pgfplots@toka=\expandafter{\pgfplots@firstplot@coords@y,}%
+ \fi
+ \edef\pgfplots@firstplot@coords@y{\the\pgfplots@toka\pgfplots@current@point@y}%
+ \fi
+ \fi
+%\pgfplots@message{FILTERING: appended \pgfplots@current@point@x,\pgfplots@current@point@y}% -> results in \pgfplots@coord@stream@recorded}%
+ \fi
+ \fi
+ %
+ % increase \pgfplots@current@point@coordindex:
+ \begingroup
+ \c@pgf@counta=\pgfplots@current@point@coordindex
+ \advance\c@pgf@counta by1\relax
+ \edef\pgfmathresult{\the\c@pgf@counta}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ \let\pgfplots@current@point@coordindex=\pgfmathresult
+}
+
+% Internal stream methods.
+%
+% Please overwrite \pgfplots@coord@stream@start@,
+% \pgfplots@coord@stream@end@ and \pgfplots@coord@stream@coord@
+% if you implement streams.
+%
+% FIXME: REPLACE THIS HERE WITH METHODS OF THE VISUALIZATION FRAMEWORK
+\newif\ifpgfplots@coord@stream@isfirst
+\def\pgfplots@coord@stream@start{
+ \pgfplots@coord@stream@isfirsttrue
+ \pgfplots@coord@stream@start@}
+\def\pgfplots@coord@stream@end{\pgfplots@coord@stream@end@}
+
+% Will be invoked for every point coordinate.
+%
+% It invokes \pgfplots@coord@stream@coord@.
+% It is expected to assign \pgfplots@current@point@x and
+% \pgfplots@current@point@y
+%
+% It is expected to
+% (#1,#2) : x, y coordinates
+% (#3,#4) : any x, y errors (or empty)
+\def\pgfplots@coord@stream@coord#1#2#3#4{%
+ \pgfplots@coord@stream@coord@{#1}{#2}{#3}{#4}%
+ \ifpgfplots@coord@stream@isfirst
+ \let\pgfplots@currentplot@firstcoord@x=\pgfplots@current@point@x
+ \let\pgfplots@currentplot@firstcoord@y=\pgfplots@current@point@y
+ \pgfplots@coord@stream@isfirstfalse
+ \fi
+ \let\pgfplots@currentplot@lastcoord@x=\pgfplots@current@point@x
+ \let\pgfplots@currentplot@lastcoord@y=\pgfplots@current@point@y
+}%
+
+% A looping method which applies
+% \pgfplots@coord@stream@start
+% for each coordinate '(x,y)' or '(x,y) +- (ex,ey)', call
+% \pgfplots@coord@stream@coord{x}{y}{ex}{ey}
+% \pgfplots@coord@stream@end
+%
+% #1 a sequence of coordinates of the form
+% '(x,y)'
+% or
+% '(x,y) +- (ex,ey)'
+% separated by white-space.
+\long\def\pgfplots@coord@stream@foreach#1{%
+ \pgfplots@coord@stream@start
+ \pgfplots@foreach@plot@coord@do%
+ \pgfplots@coord@stream@coord
+ \for
+ plot coordinates {#1};%
+ \pgfplots@EOI
+ \pgfplots@coord@stream@end
+}%
+
+% Processes coordinates and writes a new, modified 'plot coordinates'
+% command to macro #1.
+% #1: macro name for processed coordinates.
+%
+% Please note that it may be necessary to process the same coordinates
+% once more at the end of an axis - see
+% pgfplots@coord@stream@finalize@storedcoords@START
+\def\pgfplots@coord@stream@INIT#1{%
+ \def\pgfplots@coord@stream@start@{%
+ \let\pgfplots@coord@stream@recorded=\pgfutil@empty
+ }%
+ \def\pgfplots@coord@stream@end@{%
+ \pgfplots@toka=\expandafter{\pgfplots@coord@stream@recorded}%
+ \edef#1{plot coordinates {\the\pgfplots@toka}}%
+ }%
+ \let\pgfplots@coord@stream@coord@=\pgfplots@process@one@point
+}
+
+% Takes a sequence of PREPARED coordinates which are given in floating
+% point representation and applies the data scaling trafo.
+%
+% This stream is designed to be done at the end of an axis.
+% See \pgfplots@coord@stream@finalize@storedcoords@START
+\def\pgfplots@coord@stream@INIT@finalize@storedcoords#1{%
+ \def\pgfplots@coord@stream@start@{%
+ \let\pgfplots@data@scaletrafo@result=\pgfutil@empty
+ }%
+ \def\pgfplots@coord@stream@end@{%
+ \let#1=\pgfplots@data@scaletrafo@result
+ }%
+ \let\pgfplots@coord@stream@coord@=\pgfplots@apply@data@scaletrafo@to@one@point
+}
+
+\def\pgfplots@addplot@get@named@startendpoints@command#1{%
+ \edef#1{%
+ \noexpand\path
+ (\pgfplots@currentplot@firstcoord@x,\pgfplots@currentplot@firstcoord@y) coordinate (current plot begin)
+ (\pgfplots@currentplot@lastcoord@x,\pgfplots@currentplot@lastcoord@y) coordinate (current plot end)
+ ;
+ }%
+}%
+
+% INPUT:
+% a sequence of points (SMeE,SMeE) (terminated with ';')
+% where S=sign, M=mantisse, E = exponent.
+% Such input is generated in the case pgfplots@apply@datatrafotrue
+% by the coordinate filters.
+% OUTPUT:
+% proper sequence of fixed point coordinates which are the result of the
+% data scaling transformation (\pgfplots@datascaletrafo@x).
+%
+% The output will be written into the macro #3
+\long\def\pgfplots@coord@stream@finalize@storedcoords@START plot coordinates #1#2;\to#3{%
+ \pgfplots@coord@stream@finalize@storedcoords@START@ plot coordinates {#1}#2;\to#3
+ \ifpgfplots@errorbars@enabled
+ \pgfplots@errorbars@finishwithstyleoptions[current plot style]{\pgfplots@recordederrorbar}%
+ \fi
+ \pgfplots@addplot@get@named@startendpoints@command\pgfplots@TMP
+ \pgfplots@TMP
+}%
+\long\def\pgfplots@coord@stream@finalize@storedcoords@START@ plot coordinates #1#2;\to#3{%
+ \ifpgfplots@stackedmode
+ \pgfplots@stacked@beginplot
+ \fi
+ \pgfplots@coord@stream@INIT@finalize@storedcoords#3
+ \ifpgfplots@errorbars@enabled
+ \pgfplots@streamerrorbar@recordto{\pgfplots@recordederrorbar}%
+ \pgfplots@streamerrorbarstart
+ \fi
+ \pgfplots@coord@stream@foreach{#1}%
+ \ifpgfplots@stackedmode
+ \pgfplots@stacked@endplot
+ \fi
+ \pgfplots@toka=\expandafter{#3}%
+ \pgfplotslist@TOK@a={#2}%
+ \edef#3{plot coordinates {\the\pgfplots@toka}\the\pgfplotslist@TOK@a;}%
+ \ifpgfplots@errorbars@enabled
+ \pgfplots@streamerrorbarend
+ \fi
+}%
+
+% does the same job, but it does not execute any drawing commands.
+%
+% Instead, it generates a macro #4 which - if used as "precommand"
+% befor a draw operation - restores all required options and performs
+% pre-drawing.
+\long\def\pgfplots@coord@stream@finalize@storedcoords@START@dryrun plot coordinates #1#2;\to#3#4{%
+ \pgfplots@coord@stream@finalize@storedcoords@START@ plot coordinates {#1}#2;\to#3
+ \ifpgfplots@stackedmode
+ \pgfplots@stacked@savestateto\pgfplots@TMP
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@TMP}%
+ \else
+ \pgfplotslist@TOK@a={}%
+ \fi
+ \pgfplots@addplot@get@named@startendpoints@command\pgfplots@TMP
+ \pgfplots@toka=\expandafter{\pgfplots@TMP}%
+ \ifpgfplots@errorbars@enabled
+ \pgfplotslist@TOK@b=\expandafter{\pgfplots@recordederrorbar}%
+ \edef#4{%
+ \the\pgfplots@toka
+ \the\pgfplotslist@TOK@a
+ \noexpand\pgfplots@errorbars@finishwithstyleoptions[current plot style]{\the\pgfplotslist@TOK@b}%
+ }%
+ \else
+ \edef#4{%
+ \the\pgfplots@toka
+ \the\pgfplotslist@TOK@a
+ }%
+ \fi
+}%
+
+% A looping command to loop through plot coordinates.
+% For every point, #1{X}{Y} will be invoked.
+%
+% No scoping is used during this operation, so you can access outer
+% variables.
+\long\def\pgfplots@foreach@plot@coord@do#1\for plot coordinates #2;\pgfplots@EOI{%
+ \def\pgfplots@foreach@plot@coord@do@CMD{#1}%
+ \pgfplots@foreach@plot@coord@ITERATE#2\pgfplots@EOI%
+}
+
+\def\pgfplots@foreach@plot@coord@ITERATE{%
+ \pgfutil@ifnextchar\pgfplots@EOI{%
+ \pgfplots@foreach@plot@coord@FINISH%
+ }{%
+ \pgfplots@foreach@plot@coord@NEXT%
+ }%
+}
+
+\def\pgfplots@foreach@plot@coord@NEXT(#1,#2){%
+ \pgfutil@ifnextchar+{%
+ \pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE{#1}{#2}%
+ }{%
+ \pgfplots@foreach@plot@coord@do@CMD{#1}{#2}{}{}%
+ \pgfplots@foreach@plot@coord@ITERATE
+ }%
+}
+
+% processing something like '(x,y) +- (error_x,error_y)'
+\def\pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE#1#2+-#3({%
+ \pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE@{#1}{#2}%
+}
+\def\pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE@#1#2#3,#4){%
+ \pgfplots@foreach@plot@coord@do@CMD{#1}{#2}{#3}{#4}%
+ \pgfplots@foreach@plot@coord@ITERATE
+}
+
+\def\pgfplots@foreach@plot@coord@FINISH\pgfplots@EOI{}
+
+
+% for use in \ifx:
+\def\pgfplots@EOI{\pgfplots@EOI}%
+
+% #1= x coord
+% #2= y coord
+% #3= error for x coord (or empty)
+% #4= error for y coord (or empty)
+\def\pgfplots@apply@data@scaletrafo@to@one@point#1#2#3#4{%
+ \ifpgfplots@apply@datatrafo@x
+ \pgfplots@datascaletrafo@x{#1}%
+ \let\pgfplots@current@point@x=\pgfmathresult
+ \else
+ \def\pgfplots@current@point@x{#1}%
+ \fi
+ \ifpgfplots@apply@datatrafo@y
+ \pgfplots@datascaletrafo@y{#2}%
+ \let\pgfplots@current@point@y=\pgfmathresult
+ \else
+ \def\pgfplots@current@point@y{#2}%
+ \fi
+ \ifpgfplots@stackedmode
+ % all these calls work with pgfmath; no more floating point
+ % arithmetics are applied.
+ \pgfplots@stacked@getnextzerolevelpoint
+ \pgfplots@stacked@finishpoint{\pgfplots@current@point@x}{\pgfplots@current@point@y}%
+ \pgfplots@stacked@rememberzerolevelpoint@for@next@plot{(\pgfplots@current@point@x,\pgfplots@current@point@y)}%
+ \fi
+ \pgfplots@toka=\expandafter{\pgfplots@data@scaletrafo@result}%
+ \edef\pgfplots@data@scaletrafo@result{\the\pgfplots@toka(\pgfplots@current@point@x,\pgfplots@current@point@y)}%
+}
+
+% This thing here shall draw all error bar commands listed in '#2'.
+%
+% It will be invoked when any plotting commands take effect (that
+% means all limits are computed; the axis has been drawn,
+% transformations are set up...)
+\def\pgfplots@errorbars@finishwithstyleoptions[#1]#2{%
+ \scope[%/pgfplots/search path for tikz/.cd,
+ #1,/pgfplots/every error bar]%
+ #2%
+ \endscope
+}
+
+\def\pgfplots@errorbar@draw@float(#1,#2)(#3,#4){%
+ \ifpgfplots@apply@datatrafo@x
+ \pgfplots@datascaletrafo@x{#1}%
+ \let\pgfplots@xarg=\pgfmathresult%
+ \pgfplots@datascaletrafo@x{#3}%
+ \let\pgfplots@error@xarg=\pgfmathresult%
+ \else
+ \def\pgfplots@xarg{#1}%
+ \def\pgfplots@error@xarg{#3}%
+ \fi
+ \ifpgfplots@apply@datatrafo@y
+ \pgfplots@datascaletrafo@y{#2}%
+ \let\pgfplots@yarg=\pgfmathresult%
+ \pgfplots@datascaletrafo@y{#4}%
+ \let\pgfplots@error@yarg=\pgfmathresult%
+ \else
+ \def\pgfplots@yarg{#2}%
+ \def\pgfplots@error@yarg{#4}%
+ \fi
+ \edef\pgfplots@TMP{{(\pgfplots@xarg,\pgfplots@yarg)}{(\pgfplots@error@xarg,\pgfplots@error@yarg)}}%
+ \def\pgfplots@TMPB{\pgfkeysvalueof{/pgfplots/error bars/draw error bar/.@cmd}}%
+ \expandafter\pgfplots@TMPB\pgfplots@TMP\pgfeov
+}
+
+\def\pgfplots@errorbar@draw#1#2{%
+ \begingroup
+ \ifpgfplots@apply@datatrafo
+ \pgfplots@errorbar@draw@float#1#2
+ \else
+ \pgfkeysvalueof{/pgfplots/error bars/draw error bar/.@cmd}{#1}{#2}\pgfeov%
+ \fi
+ \endgroup
+}%
+
+% Also provides UNFILTERED arguments x (#5) and y (#6). These are use
+% in case of logplots, because we may need to compute log( x + e_x )
+% or log( y + e_y ).
+\def\pgfplots@process@errorbar@for#1#2#3#4#5#6{%
+% \begingroup
+ \edef\pgfplots@xarg{#1}%
+ \edef\pgfplots@yarg{#2}%
+ \def\pgfplots@xarg@unfiltered{#5}%
+ \def\pgfplots@yarg@unfiltered{#6}%
+ \edef\pgfplots@error@xarg{#3}%
+ \edef\pgfplots@error@yarg{#4}%
+ \def\pgfplots@TMP{0}%
+ \ifx\pgfplots@TMP\pgfplots@error@xarg
+ \let\pgfplots@error@xarg=\pgfutil@empty
+ \fi
+ \ifx\pgfplots@TMP\pgfplots@error@yarg
+ \let\pgfplots@error@yarg=\pgfutil@empty
+ \fi
+ % FIXME : INEFFICIENT! This code here does every computation
+ % multiple times!
+ \ifcase\pgfplots@errorbars@xdirection
+ \or
+ \pgfplots@process@errorbar@@for{x}{+}1%
+ \or
+ \pgfplots@process@errorbar@@for{x}{-}2%
+ \or
+ \pgfplots@process@errorbar@@for{x}{+}1%
+ \pgfplots@process@errorbar@@for{x}{-}2%
+ \fi
+ \ifcase\pgfplots@errorbars@ydirection
+ \or
+ \pgfplots@process@errorbar@@for{y}{+}1%
+ \or
+ \pgfplots@process@errorbar@@for{y}{-}2%
+ \or
+ \pgfplots@process@errorbar@@for{y}{+}1%
+ \pgfplots@process@errorbar@@for{y}{-}2%
+ \fi
+% \endgroup
+}
+
+% #1: either 'x' or 'y'
+% #2: either '+' or '-'
+% #3: an integer representing the argument #2. It is '1' if #2='+'
+% and '2' is #2 = '-'.
+\def\pgfplots@process@errorbar@@for#1#2#3{%
+ \expandafter\let\expandafter\ifpgfplots@is@datascaled\csname ifpgfplots@float@numerics@mode@#1\endcsname
+ \csname ifpgfplots@#1islinear\endcsname
+ \edef\pgfplots@error@src{\csname pgfplots@#1arg\endcsname}%
+ \ifcase\csname pgfplots@errorbars@#1mode\endcsname
+ % fixed absolute error.
+ \ifpgfplots@is@datascaled
+ \edef\pgfplots@error@coord{\csname pgfplots@errorbars@#1fixed\endcsname}%
+ \pgfmathfloatparsenumber{\pgfplots@error@coord}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \ifnum#3=1
+ \pgfmathfloatadd@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \else
+ \pgfmathfloatsubtract@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \fi
+ \else
+ \edef\pgfplots@error@coord{\csname pgfplots@errorbars@#1fixed\endcsname}%
+ \pgfmathparse{\pgfplots@error@src#2 \pgfplots@error@coord}%
+ \fi
+ \let\pgfplots@error@coord=\pgfmathresult
+ \or% fixed relative error:
+ \ifpgfplots@is@datascaled
+ \pgfmathparse{(1#2\csname pgfplots@errorbars@#1rel\endcsname)}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \pgfmathfloatmultiplyfixed@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \else
+ \pgfmathparse{\pgfplots@error@src*(1#2\csname pgfplots@errorbars@#1rel\endcsname)}%
+ \fi
+ \let\pgfplots@error@coord=\pgfmathresult
+ \or% explicit absolute:
+ \edef\pgfplots@error@coord{\csname pgfplots@error@#1arg\endcsname}%
+ \ifx\pgfplots@error@coord\pgfutil@empty
+ \else
+ \ifpgfplots@is@datascaled
+ \pgfmathfloatparsenumber{\pgfplots@error@coord}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \ifnum#3=1
+ \pgfmathfloatadd@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \else
+ \pgfmathfloatsubtract@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \fi
+ \else
+ \pgfmathparse{\pgfplots@error@src#2 \pgfplots@error@coord}%
+ \fi
+ \let\pgfplots@error@coord=\pgfmathresult
+ \fi
+ \or% explicit relative:
+ \edef\pgfplots@error@coord{\csname pgfplots@error@#1arg\endcsname}%
+ \ifx\pgfplots@error@coord\pgfutil@empty
+ \else
+ \ifpgfplots@is@datascaled
+ \pgfmathparse{(1#2\pgfplots@error@coord)}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \pgfmathfloatmultiplyfixed@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \else
+ \pgfmathparse{\pgfplots@error@src*(1#2\pgfplots@error@coord)}%
+ \fi
+ \let\pgfplots@error@coord=\pgfmathresult
+ \fi
+ \fi
+ \else
+ % LOGARITHMIC scaling. All errors are interpreted as
+ % log(x +- e_x)
+ % or
+ % log( x*(1+-e_x) )
+ \ifcase\csname pgfplots@errorbars@#1mode\endcsname
+ % fixed absolute, log( x +- e_x )
+ \edef\pgfplots@error@src{\csname pgfplots@#1arg@unfiltered\endcsname}%
+ \edef\pgfplots@error@coord{\csname pgfplots@errorbars@#1fixed\endcsname}%
+ \pgfmathfloatparsenumber{\pgfplots@error@coord}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \pgfmathfloatparsenumber{\pgfplots@error@src}%
+ \let\pgfplots@error@src=\pgfmathresult
+ \ifnum#3=1
+ \pgfmathfloatadd@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \else
+ \pgfmathfloatsubtract@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \fi
+ \pgfmathlog@float{\pgfmathresult}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \or% fixed relative, log( x ( 1+-e_x ) ) = log(x) + log(1+-e_x)
+ \edef\pgfplots@error@src{\csname pgfplots@#1arg\endcsname}%
+ \pgfmathparse{\pgfplots@error@src + ln(1#2\csname pgfplots@errorbars@#1rel\endcsname)}%
+ \let\pgfplots@error@coord=\pgfmathresult%
+ \or% explicit absolute
+ \edef\pgfplots@error@src{\csname pgfplots@#1arg@unfiltered\endcsname}%
+ \edef\pgfplots@error@coord{\csname pgfplots@error@#1arg\endcsname}%
+ \ifx\pgfplots@error@coord\pgfutil@empty
+ \else
+ \pgfmathfloatparsenumber{\pgfplots@error@coord}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \pgfmathfloatparsenumber{\pgfplots@error@src}%
+ \let\pgfplots@error@src=\pgfmathresult
+ \ifnum#3=1
+ \pgfmathfloatadd@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \else
+ \pgfmathfloatsubtract@{\pgfplots@error@src}{\pgfplots@error@coord}%
+ \fi
+ \pgfmathlog@float{\pgfmathresult}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \fi
+ \or% explicit relative:
+ \edef\pgfplots@error@src{\csname pgfplots@#1arg\endcsname}%
+ \edef\pgfplots@error@coord{\csname pgfplots@error@#1arg\endcsname}%
+ \ifx\pgfplots@error@coord\pgfutil@empty
+ \else
+ \pgfmathparse{\pgfplots@error@src + ln(1#2 \pgfplots@error@coord)}%
+ \let\pgfplots@error@coord=\pgfmathresult%
+ \fi
+ \fi
+ \fi
+ \ifx\pgfplots@error@coord\pgfutil@empty
+ \else
+ \def\pgfplots@TMP{#1}%
+ \def\pgfplots@TMPB{x}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ \ifpgfplots@autocomputelimits
+ \pgfplots@update@limits@for@one@point{\pgfplots@error@coord}{\pgfplots@yarg}{}{}%
+ \fi
+ \edef\pgfplots@TMP{%
+ {(\pgfplots@xarg,\pgfplots@yarg)}%
+ {(\pgfplots@error@coord,\pgfplots@yarg)}%
+ }%
+ \else
+ \ifpgfplots@autocomputelimits
+ \pgfplots@update@limits@for@one@point{\pgfplots@xarg}{\pgfplots@error@coord}{}{}%
+ \fi
+ \edef\pgfplots@TMP{%
+ {(\pgfplots@xarg,\pgfplots@yarg)}%
+ {(\pgfplots@xarg,\pgfplots@error@coord)}%
+ }%
+ \fi
+ \expandafter\pgfplots@streamerrorbarcoords\pgfplots@TMP
+ \fi
+}
+
+\long\def\pgfplots@path#1;{%
+ \pgfplots@path@enqueue{#1;}%
+}
+
+% This thing here shall be used to replace any '\path' where \axispath
+% shall be used.
+\long\def\pgfplots@replacement@for@tikz@path#1;{%
+ \axispath\path#1;%
+}
+
+
+% Will be available as \closedcycle command inside of an axis.
+%
+% It closes the current plot by drawing lines to the last "zero
+% level".
+%
+% That means the current plot is connected orthogonally with the
+% x-axis, allowing fill commands.
+%
+% For stacked plots, \closedcycle is special (it connects with the
+% previous \addplot command).
+%
+% Example:
+% \addplot coordinates {(3,0.5) (4,2) (5,1)} \closedcycle;
+\def\pgfplots@path@closed@cycle{%
+ \ifpgfplots@stackedmode
+ \pgfplots@stacked@path@closed@cycle
+ \else
+ \pgfplots@path@closed@cycle@std
+ \fi
+}
+\def\pgfplots@path@closed@cycle@std{%
+ |- (perpendicular cs:
+ vertical line through={(current plot begin)},
+ horizontal line through={(\pgfplots@ZERO@x,\pgfplots@ZERO@y)})
+ -- cycle
+}%
+
+% Remembers the plotting command #2 and '#3=plot coordinates {...} ...';
+% for later postprocessing of the coordinates.
+%
+% #1: commands which should be executed before issueing the plotting
+% command #2 #3.
+% #2:
+% the command which is responsable for drawing.
+% - If #2 is NOT '\pgfutil@empty', we expect #3 to contain only
+% EXPANDABLE DATA.
+% That's important for postponed floating point arithmetics in #3.
+% - If #2='\pgfutil@empty', we don't make any assumption about #3
+% and process it as-is.
+%
+% #3: see above.
+%
+% #4: commands which should be executed after '#2 #3'.
+%
+\long\def\pgfplots@path@enqueue@coords#1#2#3#4{%
+ \ifpgfplots@draw@at@end
+ \begingroup
+ \globaldefs=1
+ \pgfplotslistpushback{#1}{#2}{#3}{#4}\to\pgfplots@stored@plotlist
+ \endgroup
+ \else
+ \begingroup
+ #1#2#3#4%
+ \endgroup
+ \fi
+}
+
+% The same as \pgfplots@path@enqueue@coords, but this here also stores
+% \pgfplots@addplot@nonlegend@options
+\long\def\pgfplots@addplot@enqueue@coords#1#2#3#4{%
+ \ifpgfplots@draw@at@end
+ \ifx\pgfplots@addplot@nonlegend@options\pgfutil@empty
+ \pgfplots@path@enqueue@coords{#1}{#2}{#3}{#4}%
+ \else
+ \expandafter
+ \pgfplots@path@enqueue@coords
+ \expandafter{%
+ \expandafter\tikzset\expandafter{\pgfplots@addplot@nonlegend@options}%
+ #1}{#2}{#3}{#4}%
+ \fi
+ \else
+ \pgfplots@path@enqueue@coords{#1}{#2}{#3}{#4}%
+ \fi
+}
+
+
+% Remembers the plotting command #1.
+\long\def\pgfplots@path@enqueue#1{%
+ \pgfplots@path@enqueue@coords{}{}{#1}{}%
+}
+
+
+% Assigns a legend.
+% Syntax:
+% \legend{entry 1\\entry2\\entry3}
+\def\pgfplots@command@legend{
+ \pgfutil@ifnextchar[{%
+ \pgfplots@error{Sorry, legend options are now deprecated. Legends are now TikZ-matrizes which provide better alignment and can be placed horizontally. See the manual for details.}%
+ }{%
+ \pgfplots@command@legend@impl
+ }%
+}
+
+\def\pgfplots@command@legend@impl#1{%
+ \pgfplots@assign@list\pgfplots@TMPC{#1}%
+ \global\let\pgfplots@legend=\pgfplots@TMPC
+}
+
+
+\def\pgfplots@addlegendentry{%
+ \pgfutil@ifnextchar[{%
+ \pgfplots@addlegendentry@opts
+ }{%
+ \pgfplots@addlegendentry@opts[]%
+ }%
+}
+\def\pgfplots@addlegendentry@opts[#1]#2{%
+ {%
+ \globaldefs=1% this will ONLY store the options and the legend into global variables
+ \pgfplotslistpushback[#1]#2\to\pgfplots@legend
+ }%
+}
+
+\def\pgfplots@pop@next@legend{{%
+ \globaldefs=1
+ \pgfplotslistcheckempty\pgfplots@plotspeclist
+ \ifpgfplotslistempty
+ \let\pgfplots@curplotlist=\pgfutil@empty
+ \else
+ \pgfplotslistpopfront\pgfplots@plotspeclist\to\pgfplots@curplotlist
+ \fi
+ %
+ \pgfplotslistcheckempty\pgfplots@legend
+ \ifpgfplotslistempty
+ \let\pgfplots@curlegend=\pgfutil@empty
+ \else
+ \pgfplotslistpopfront\pgfplots@legend\to\pgfplots@curlegend
+ \fi
+ \advance\pgfplots@numplots by-1
+}}
+
+% This routine is called at the begin of every plot.
+% It initialised a zero level stream.
+%
+% The default is to use '0' as zero level streams.
+%
+% This method is called as "precommand"; before any Tikz drawing
+% commands have been started.
+\def\pgfplots@initzerolevelhandler{%
+ \ifpgfplots@stackedmode
+ % ATTENTION: this thing here says:
+ % "draw zero level coordinates from list XYZ."
+ % But at the time of this initialisation, the list will be EMPTY!
+ %
+ % It will be filled later. That's ok, because
+ % \pgfplots@initzerolevelhandler will be
+ % used as 'precommand', that means before Tikz sees any
+ % coordinates.
+ \pgfplots@stacked@initzerolevelhandler
+ \else
+ \pgfplotxzerolevelstreamconstant{\pgfplots@ZERO@x}%
+ \pgfplotyzerolevelstreamconstant{\pgfplots@ZERO@y}%
+ \fi
+}
+
+\def\pgfplots@try@mirror@plot@handler{%
+ \pgfutil@ifundefined{tikz@plot@handler}{}{%
+ \ifx\tikz@plot@handler\pgfplothandlerconstantlineto
+ \let\tikz@plot@handler=\pgfplothandlerconstantlinetomarkright
+ \else
+ \ifx\tikz@plot@handler\pgfplothandlerconstantlinetomarkright
+ \let\tikz@plot@handler=\pgfplothandlerconstantlineto
+ \fi
+ \fi
+ }%
+}
+
+\long\def\pgfplots@show@small@legendplots#1#2{
+ \begingroup
+ \def\pgfplots@TMPB{#1}%
+ \ifx\pgfplots@TMPB\pgfutil@empty
+ \else
+ \pgfqkeys{/pgfplots/search path for tikz}{#1}%
+ \fi
+ \pgfkeysvalueof{/pgfplots/legend image code/.@cmd}#2\pgfeov
+ \endgroup
+}
+
+\def\pgfplots@split@opts{%
+ \pgfutil@ifnextchar[{%
+ \pgfplots@split@opts@opts
+ }{%
+ \pgfplots@split@opts@opts[]%
+ }%
+}
+\def\pgfplots@split@opts@opts[#1]#2\pgfplots@result@to#3#4{%
+ \def#3{#2}%
+ \def#4{#1}%
+}
+
+% Typesets a legend node.
+%
+% It will either typeset a previously computed legend (which needs to be
+% stored in the macro \pgfplots@already@computed@legend@node)
+%
+% or it creates a legend, stores the commands into the macro named
+% above and typesets it.
+\def\pgfplots@createlegend{%
+ \ifx\pgfplots@already@computed@legend@node\pgfutil@empty
+ \pgfplotslistcheckempty\pgfplots@legend
+ \ifpgfplotslistempty
+ \else
+ %
+ %
+ \begingroup
+ % assemble a
+ % \matrix {
+ % small plot & legend1\\
+ % small plot & legend2\\
+ % ...
+ % };
+ % command [and using the 'legend columns' option]
+ %
+ % \pgfplotslist@TOK@a={
+ % small plot & legend1\\
+ % small plot & legend2\\
+ % ...
+ % }
+ % ( I have allocated the token registers in my
+ % liststructure.sty)
+ %
+ % \global\def\pgfplots@TMP{
+ % \matrix {
+ % \TOKL@TA
+ % };
+ % }
+ % -> finally, \pgfplots@TMP will contain the complete command.
+ \pgfplotslist@TOK@a={}%
+ \let\curcolumnNum=\c@pgf@counta
+ \let\maxcolumnCount=\c@pgf@countb
+ \let\legendplotpos=\c@pgf@countc
+ \legendplotpos\expandafter=\pgfplots@legend@plot@pos
+ \curcolumnNum=0
+ \maxcolumnCount=\pgfplots@legend@columns\relax
+ %
+ \loop
+ \ifnum0<\pgfplots@numplots\relax
+ \pgfplots@pop@next@legend
+ \ifx\pgfplots@curlegend\pgfutil@empty
+ \else
+ \advance\curcolumnNum by1
+ \begingroup
+ \expandafter\pgfplots@split@opts\pgfplots@curlegend\pgfplots@result@to{\pgfplots@curlegend}{\pgfplots@curlegend@opts}%
+ \ifcase\legendplotpos
+ % legend plot pos=left
+ \pgfplotslist@TOK@b=\expandafter{%
+ \expandafter\pgfplots@show@small@legendplots
+ \expandafter{\pgfplots@curlegend@opts}}%
+ \pgfplotslist@TOK@b=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfplotslist@TOK@b\expandafter{\pgfplots@curplotlist}%
+ \pgfmatrixnextcell\node}%
+ \pgfplotslist@TOK@b=\expandafter\expandafter\expandafter{%
+ \expandafter\the\expandafter\pgfplotslist@TOK@b
+ \expandafter{\pgfplots@curlegend};}%
+ \or
+ % legend plot pos=right
+ \pgfplotslist@TOK@b=\expandafter{%
+ \expandafter\node
+ \expandafter{\pgfplots@curlegend};%
+ \pgfmatrixnextcell
+ \pgfplots@show@small@legendplots}%
+ \pgfplotslist@TOK@b=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfplotslist@TOK@b\expandafter{\pgfplots@curlegend@opts}}%
+ \pgfplotslist@TOK@b=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgfplotslist@TOK@b\expandafter{\pgfplots@curplotlist}}%
+ \or
+ % legend plot pos=none
+ \pgfplotslist@TOK@b=\expandafter{\expandafter\node\expandafter{\pgfplots@curlegend};}%
+ \fi
+ \ifnum\curcolumnNum=\maxcolumnCount
+ \pgfplotslist@TOK@b=\expandafter{\the\pgfplotslist@TOK@b\\}%
+ \else
+ \ifnum\pgfplots@numplots=0
+ \pgfplotslist@TOK@b=\expandafter{\the\pgfplotslist@TOK@b\\}%
+ \else
+ \pgfplotslist@TOK@b=\expandafter{\the\pgfplotslist@TOK@b\pgfmatrixnextcell}%
+ \fi
+ \fi
+ \xdef\pgfplots@TMP{%
+ \the\pgfplotslist@TOK@a
+ \the\pgfplotslist@TOK@b
+ }%
+ \endgroup
+ \ifnum\curcolumnNum=\maxcolumnCount
+ \curcolumnNum=0
+ \fi
+ \expandafter\pgfplotslist@TOK@a\expandafter{\pgfplots@TMP}%
+ \fi
+ \repeat
+ \pgfplotslist@TOK@b={\matrix[/pgfplots/every axis legend]}%
+ \xdef\pgfplots@TMP{%
+ \noexpand\def\noexpand\plotnum{0}%
+ \the\pgfplotslist@TOK@b {%
+ \the\pgfplotslist@TOK@a
+ };%
+ }%
+ \endgroup
+ \let\pgfplots@already@computed@legend@node=\pgfplots@TMP
+ \fi
+ \fi
+%\pgfplots@message{Vor legende: \meaning\pgfplots@already@computed@legend@node}%
+ \pgfplots@already@computed@legend@node
+}
+
+\newif\ifpgfplots@checkuniform@isfirst
+% Checks whether the argument to xtick or ytick is a UNIFORM tick
+% sequence.
+%
+% A uniform tick sequence is 0,...,10 and 3,4,5 and -5,-4,-2 but
+% NOT 0,2,4 or 4,10.
+%
+% Furthermore, any NON-integer tick arguments are also assumed to be
+% NOT uniform.
+%
+% INPUT:
+% #1: a tick argument (i.e. something which can be put to
+% \foreach \x in {#1})
+%
+% OUTPUT:
+% \pgfplots@isuniformticktrue
+% or
+% \pgfplots@isuniformtickfalse
+% depending on the check.
+% This variable will be set globally.
+\def\pgfplots@checkisuniformLOGtick#1{%
+ \begingroup
+ \global\pgfplots@isuniformticktrue
+ \pgfplots@checkuniform@isfirsttrue
+ \foreach \x in {#1}{%
+ \pgfmathmultiply@\x\reciproclogten
+ \let\cur=\pgfmathresult
+ % check whether
+ % \cur - last == 1 (last = \pgfplots@TMPB)
+ \ifpgfplots@checkuniform@isfirst
+ \global\pgfplots@checkuniform@isfirstfalse
+ \else
+ \pgfmathsubtract@\cur\pgfplots@TMPB%
+ \pgfmathapproxequalto@\pgfmathresult{1.0}%
+ \ifpgfmathcomparison
+ \else
+ \global\pgfplots@isuniformtickfalse
+ \breakforeach
+ \fi
+ \fi
+ \global\let\pgfplots@TMPB=\cur
+ }%
+ \endgroup
+}
+
+% Checks whether the linear tick sequence #1 is a uniform tick.
+%
+% It also assigns pgfplots@tick@distance@#1 as the distance.
+%
+% see \pgfplots@checkisuniformLOGtick for details.
+\def\pgfplots@checkisuniformLINEARtick#1{%
+ \begingroup
+ \global\pgfplots@isuniformticktrue
+ \pgfplots@checkuniform@isfirsttrue
+ \global\let\pgfplots@TMPB=\pgfutil@empty
+ \global\let\pgfplots@TMP=\relax
+ \foreach \x in {#1}{%
+ \ifx\pgfplots@TMPB\pgfutil@empty
+ \else
+ \pgfmathsubtract@\x\pgfplots@TMPB
+ \ifpgfplots@checkuniform@isfirst
+ % remember first distance h = x_1 - x_0
+ \global\let\pgfplots@TMP=\pgfmathresult
+ \global\pgfplots@checkuniform@isfirstfalse
+ \else
+ % check whether x_i - x_{i-1} = h
+ \pgfmathapproxequalto@\pgfmathresult\pgfplots@TMP%
+ \ifpgfmathcomparison
+ \else
+ \global\pgfplots@isuniformtickfalse
+ \breakforeach
+ \fi
+ \fi
+ \fi
+ \global\let\pgfplots@TMPB=\x%
+ }%
+ \endgroup
+ \expandafter\let\csname pgfplots@tick@distance@#1\endcsname=\pgfplots@TMP
+}
+
+\def\skipsuffixzero#1.#2|{
+ {%
+ \def\pgfplots@TMP{#2}%
+ \def\pgfplots@TMPB{0}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ \global\def\pgfmathresult{#1}%
+ \else
+ \global\def\pgfmathresult{#1.#2}%
+ \fi
+ }%
+}
+
+\def\pgfmathlogtologten#1{%
+ \pgfmathparse{#1}%
+ \expandafter\pgfmathlogtologten@\expandafter{\pgfmathresult}%
+}
+
+% Simply divides #1 by log(10).
+\def\pgfmathlogtologten@#1{%
+ \pgfmathmultiply@{#1}\reciproclogten%
+}%
+
+% DEPRECATED.
+\def\logtologtentomacro#1#2{%
+ \pgfmathmultiply@{#1}\reciproclogten%
+ \expandafter\skipsuffixzero\pgfmathresult|%
+ \let#2=\pgfmathresult
+}
+
+% DEPRECATED.
+\def\logtologten#1{%
+ \pgfmathmultiply@{#1}\reciproclogten%
+ \expandafter\skipsuffixzero\pgfmathresult|%
+ \pgfmathresult
+}
+
+% helper method which computes log10*\x foreach \x in {#1}.
+% The result will be \xdef'ed into #2.
+\def\pgfplots@compute@tick@times@logten#1\to#2{%
+ \global\let#2=\pgfutil@empty
+ \foreach \pgfplots@TMPB in {#1} {%
+ \pgfmathmultiply@\pgfplots@TMPB\logten%
+ \ifx#2\pgfutil@empty
+ \xdef#2{\pgfmathresult}%
+ \else
+ \xdef#2{#2,\pgfmathresult}%
+ \fi
+ }%
+}
+
+\def\pgfplots@init@enlarge@limit@booleans{%
+ \pgfplots@enlargelimits@autofalse
+ \pgfplots@enlargelimitsfalse
+ \pgfplots@enlargelimits@rel@threshfalse
+ \edef\pgfplots@TMP{\pgfplots@enlargelimits}%
+ %
+ \def\pgfplots@TMPB{true}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ \pgfplots@enlargelimitstrue
+ \else
+ \def\pgfplots@TMPB{false}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ \else
+ \def\pgfplots@TMPB{auto}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ \pgfplots@enlargelimits@autotrue
+ \else
+ \begingroup
+ % try to read it as number:
+ \expandafter\pgf@xa\pgfplots@enlargelimits pt\relax
+ \endgroup
+ \pgfplots@enlargelimitstrue
+ \pgfplots@enlargelimits@rel@threshtrue
+ \fi
+ \fi
+ \fi
+}
+
+\def\pgfplots@enlarge@limit@for#1{%
+ \begingroup
+ \expandafter\let\expandafter\min\expandafter=\csname pgfplots@#1min\endcsname
+ \expandafter\let\expandafter\max\expandafter=\csname pgfplots@#1max\endcsname
+ \ifpgfplots@enlargelimits@rel@thresh
+ \edef\enlargepercent{\pgfplots@enlargelimits}%
+ \else
+ \def\enlargepercent{0.1}% FIXME : pack 10% as default into option 'enlargelimits' or so
+ \fi
+ \pgfmathsubtract@\max\min%
+ \pgf@xa\pgfmathresult pt
+ \pgf@xb\enlargepercent\pgf@xa
+ \ifdim\pgf@xb>0.001pt
+ % the case with
+ % enlargeabsolute ~= 0
+ % means that \min ~= \max.
+ % It is handled in another method.
+ \edef\enlargeabsolute{\pgf@sys@tonumber{\pgf@xb}}%
+ %
+ % compute xmin := xmin - enlargeabsolute
+ \pgfmathsubtract@\min\enlargeabsolute%
+ \let\min=\pgfmathresult
+ \pgfmathadd@\max\enlargeabsolute%
+ \let\max=\pgfmathresult
+ \fi
+ \xdef\pgfplots@TMP{\min}%
+ \xdef\pgfplots@TMPB{\max}%
+ \endgroup
+ \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfplots@TMP
+ \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfplots@TMPB
+}
+
+% Computes tick positions using the current axis limits.
+%
+% Parameters:
+% /pgfplots/max space between ticks
+% Determines the maximum space which is not filled by at least one
+% tick label (approximate, there is some rounding internally)
+% /pgfplots/try min ticks
+% see manual
+%
+% Idea:
+% We want ticks at each
+% { i*H, i in \Z }.
+% Of course, there shouldn't be TOO MUCH ticks.
+%
+% Our heuristics is to set
+% desirednumticks = round(ACTUAL WIDTH / (max space between ticks) )
+% and generate H = (axis range) / (desirednumticks).
+%
+% Since not all step sizes H look well, restrict H to a set of allowed
+% step sizes such as
+% { 1, 1/2, 1/5, 1/10 },
+% or, to be more precise:
+% { 1*10^e, 2*10^e, 5*10^e }
+% -> round to the nearest matching number!
+%
+% For log-plots,
+% H in { j*log(10), j=1,2,3,... }
+% where the usual case should be j = 1.
+%
+% Then, the resulting tick is
+% TICK={MIN,MIN+H,...,MAX}
+% where
+% MIN = I*H
+% is chosen such that
+% axis minimum limit = I*H + rest; |rest| < H.
+%
+% Again, log plots follow a slightly different approach: here,
+% MIN = I * log(10)
+% is chosen such that
+% axis minimum limit = I*log(10) + rest; |rest| < log(10)
+% while H = j*log(10), j>=1.
+%
+%
+% PRECONDITION:
+% - limits are correct
+% - axis width/height is set correctly
+%
+% POSTCONDITION:
+% - Tick for axis #1 is assigned
+% - \ifpgfplots@determinedefaultvalues@needs@check@uniformtick is set
+%
+% REMARKS:
+% - this algorithms works also if the data range has been transformed
+% with a LINEAR transformation.
+% ATTENTION: as of 2008-05-15, the scaling trafo is AFFINE LINEAR.
+% That means we have to eliminate the 'affine' shifting before the
+% algorithms works correctly.
+\def\pgfplots@assign@default@tick@foraxis#1{%
+ \begingroup
+ % Shortcut-names:
+ \expandafter\let\expandafter\ifpgfplots@is@datascaled\csname ifpgfplots@apply@datatrafo@#1\endcsname
+ % Attention here: use UNSHIFTET scalings, see remark above
+ \expandafter\let\expandafter\pgfplots@data@scale@trafo\csname pgfplots@datascaletrafo@#1@noshift\endcsname
+ \expandafter\let\expandafter\pgfplots@data@scale@inverse@trafo\csname pgfplots@inverse@datascaletrafo@#1@noshift\endcsname
+ \expandafter\let\expandafter\ifpgfplots@cur@is@linear\csname ifpgfplots@#1islinear\endcsname
+ %
+ \let\desirednumticks=\c@pgf@countd
+ \let\Wr=\pgf@xc
+ \Wr=\csname pgfplots@#1coordmaxTEX\endcsname
+ \advance\Wr by-\csname pgfplots@#1coordminTEX\endcsname
+ % r = max place without ticks in pt -> choose desirednumticks >= W/r
+ \expandafter\expandafter\divide\Wr\axisdefaulttickwidth
+ \pgfmathsetcount{\desirednumticks}{\Wr}%
+ \advance\desirednumticks by1
+ \csname ifpgfplots@#1islinear\endcsname
+ \expandafter\ifnum\axisdefaulttryminticks>\desirednumticks
+ \expandafter\desirednumticks\axisdefaulttryminticks
+ \fi
+ \else
+ \expandafter\ifnum\pgfplots@default@try@minticks@log>\desirednumticks
+ \expandafter\desirednumticks\pgfplots@default@try@minticks@log\relax
+ \fi
+ \expandafter\ifx\csname pgfplots@#1tickten\endcsname\pgfutil@empty
+ \else
+ % log plot and tickten-option: provide special processing.
+ \edef\pgfplots@TMP{\csname pgfplots@#1tickten\endcsname}%
+ \expandafter\pgfplots@compute@tick@times@logten\pgfplots@TMP\to\pgfplots@TMP
+ \expandafter\let\csname pgfplots@#1tick\endcsname=\pgfplots@TMP
+ \aftergroup\pgfplots@determinedefaultvalues@needs@check@uniformticktrue
+ \fi
+ \fi
+ %
+ \expandafter\ifx\csname pgfplots@#1tick\endcsname\pgfutil@empty
+ % Ok, we have either log or linear axis and need default
+ % ticks MIN,MIN+H,...,MAX.
+ \let\MINH=\pgf@xa
+ \let\H=\pgf@xb
+ \let\MAX=\pgfplots@tmpa
+ \let\MIN=\pgfplots@tmpb
+ % compute step size 'H':
+ \expandafter\MAX\csname pgfplots@#1max\endcsname pt
+ \advance\MAX by0.001pt% avoid round errors
+ %\expandafter\MIN\the\c@pgf@counta pt
+ \expandafter\MIN\csname pgfplots@#1min\endcsname pt
+ \H=\MAX
+ \advance\H by-\MIN
+ \c@pgf@counta=\desirednumticks
+ \advance\c@pgf@counta by-1
+ \divide\H by\c@pgf@counta
+%\message{determining ticks for #1-axis: Wr := (width/max space between ticks) = \the\Wr, desirednumticks=max(\axisdefaulttryminticks, trunc(Wr)) = \the\desirednumticks, H#1=(axis range/(desirednumticks-1)) = \the\H}%
+ %
+ % SEARCH for the NEXT FEASABLE H.
+ \edef\Hmacro{\pgf@sys@tonumber\H}%
+ \ifpgfplots@cur@is@linear
+ % CASE LINEAR AXIS
+ \ifpgfplots@is@datascaled
+ % This here works if the scaling trafo is linear.
+ \expandafter\pgfplots@data@scale@inverse@trafo\expandafter{\Hmacro}%
+ \let\Hmacro=\pgfmathresult
+ \else
+ \pgfmathfloatparsenumber{\Hmacro}%
+ \let\Hmacro=\pgfmathresult
+ \fi
+ \expandafter\pgfmathfloat@decompose\pgfmathresult\relax\pgfmathfloat@a@S\H\pgfmathfloat@a@E
+%\message{Got T^{-1}(H#1) = \Hmacro}%
+ % modify the mantisse:
+ \ifdim\H<2pt
+ \ifdim\H<1.5pt
+ \H=1.0pt
+ \else
+ \H=2.0pt
+ \fi
+ \else
+ \ifdim\H<4.9999pt
+ \ifdim\H<3.5pt
+ \H=2.0pt\relax
+ \else
+ \H=5.0pt\relax
+ \fi
+ \else
+ \ifdim\H<7.5pt
+ \H=5.0pt\relax
+ \else
+ \H=1.0pt\relax
+ \advance\pgfmathfloat@a@E by1
+ \fi
+ \fi
+ \fi
+%\message{Computed H#1=\the\H [unscaled]; transforming ... }%
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\pgf@sys@tonumber{\H}}{\the\pgfmathfloat@a@E}%
+ \let\Hmacro=\pgfmathresult
+ \ifpgfplots@is@datascaled
+ \pgfplots@data@scale@trafo\Hmacro
+ \else
+ \pgfmathfloattofixed\Hmacro
+ \fi
+ \let\Hmacro=\pgfmathresult
+%\message{got H#1=\Hmacro\ [transformed]}%
+ \expandafter\H\Hmacro pt
+ \expandafter\aftergroup\csname pgfplots@determinedefaultvalues@#1isuniformtrue\endcsname
+ %
+ % Now, we want to activate the Tick set {i*H, i in \Z}
+ % compute I such that
+ % xmin = I * H + rest; |rest| < H
+ % -> I = round(xmin/H)
+ % -> MIN = I * H
+ %
+ % but first: eliminate any 'affine' data scaling!
+ \ifpgfplots@is@datascaled
+ \advance\MIN by\csname pgfplots@data@scale@trafo@SHIFT@#1\endcsname pt
+ \fi
+ \pgfmathlog@invoke@expanded\pgfmathdivide@{%
+ {\pgf@sys@tonumber\MIN}%
+ {\pgf@sys@tonumber\H}%
+ }%
+ \pgfmathsetcount{\c@pgf@counta}{\pgfmathresult}%
+ \ifdim\MIN<0pt
+ % the truncation rounds TOWARDS 0 which is not what I want.
+ \advance\c@pgf@counta by-1
+ \fi
+ \MIN=\H
+ \multiply\MIN by\c@pgf@counta
+ \ifpgfplots@is@datascaled
+ \advance\MIN by-\csname pgfplots@data@scale@trafo@SHIFT@#1\endcsname pt
+ \fi
+ \else
+ % CASE LOG AXIS
+ %
+ % search for the "best" H= j* log(10), j an integer.
+ %
+ % And prefer j=1 if that is possible (otherwise minor
+ % ticks are not useful).
+ \pgfmathmultiply@{\Hmacro}{\reciproclogten}%
+ \expandafter\H\pgfmathresult pt
+%\message{ [ H / log(10) = \pgfmathresult}%
+ \ifdim\H<2pt
+ \H=1pt
+ \else
+ \ifnum\H<1pt
+ \H=1pt
+ \else
+ \expandafter\pgfmathfloor\expandafter{\pgfmathresult}%
+ \expandafter\H\pgfmathresult pt
+ \fi
+ \fi
+ \ifdim\H=1pt
+ \expandafter\aftergroup\csname pgfplots@determinedefaultvalues@#1isuniformtrue\endcsname
+ \pgfplots@isuniformticktrue
+ \else
+ \expandafter\aftergroup\csname pgfplots@determinedefaultvalues@#1isuniformfalse\endcsname
+ \pgfplots@isuniformtickfalse
+ \fi
+%\message{final H=\pgf@sys@tonumber{\H} * log(10)}%
+ \H=\logten\H\relax
+ % Now, we want to activate the Tick set
+ % {lowest, lowest+H, ..., highest}
+ %
+ % Where
+ % lowest = I * log(10) + rest, |rest| < log(10).
+ % this is conceptionally different from the approach for
+ % linear axes, because H = j*log(10).
+ %
+ % remember the original xmin in MINH:
+ \MINH=\MIN
+ %
+ % and compute I and I*log(10) here:
+ \expandafter\MIN\reciproclogten\MIN\relax
+ \edef\pgfmathresult{\pgf@sys@tonumber{\MIN}}%
+ \pgfmathsetcount{\c@pgf@counta}{\pgfmathresult}%
+ \ifdim\MIN<0pt
+ % the truncation rounds TOWARDS 0 which is not what I want.
+ \advance\c@pgf@counta by-1
+ \fi
+ \expandafter\MIN\logten pt
+ \multiply\MIN by\c@pgf@counta
+ \ifpgfplots@isuniformtick
+ \else
+ % This here is a special case to move the first tick
+ % near the lower axis limit.
+ %
+ % "Near" means either directly above or directly below ymin.
+ %
+ % My application example is as follows:
+ % Let H = 2*log(10).
+ % Furthermore, ymin = 3e-6, ymax= 8e-2. That means we can choose either
+ % 10^{-5}, 10^{-3}, 10^{-1}
+ % or
+ % 10^{-4}, 10^{-2}
+ % as ticks. Well, I prefer the first one.
+ %
+ % HEURISTICS: start as near to ymin as possible!
+ %
+ % We check here if we can come nearer to ymin if we
+ % shift the current tick by log(10):
+ % if( ymin - I * log(10) < 0.5*H -> use I+1, that means add log(10).
+ %
+ % that's equivalent to
+ % 2*(ymin - I * log(10)) - H < 0.
+ \advance\MINH by-\MIN
+ \multiply\MINH by2
+ \advance\MINH by-\H
+ %
+ \ifdim\MINH<0pt
+ \expandafter\advance\expandafter\MIN\logten pt
+ \fi
+ \fi
+ \fi
+ \MINH=\MIN
+ \advance\MINH by\H
+%\pgfplots@message{final H=\the\H}%
+ \xdef\pgfplots@TMP{\pgf@sys@tonumber{\MIN},\pgf@sys@tonumber{\MINH},...,\pgf@sys@tonumber{\MAX}}%
+ \xdef\pgfplots@TMPB{\pgf@sys@tonumber{\H}}%
+ \aftergroup\pgfplots@determinedefaultvalues@needs@check@uniformtickfalse
+ \fi
+ \endgroup
+ \expandafter\let\csname pgfplots@#1tick\endcsname=\pgfplots@TMP
+ \expandafter\let\csname pgfplots@tick@distance@#1\endcsname=\pgfplots@TMPB
+%\pgfplots@message{pgfplots.sty: #1tick set to \csname pgfplots@#1tick\endcsname [#1mode=\the\csname pgfplots@#1mode\endcsname, #1min=\csname pgfplots@#1min\endcsname, #1max=\csname pgfplots@#1max\endcsname].}%
+}
+
+% Helper method for
+% \pgfplots@apply@data@scale@trafo@to@options@for
+% #1: the ticks
+% #2: the trafo macro name
+% #3: the output macro name
+\long\def\pgfplots@apply@data@scale@trafo@to@user@ticks#1#2\to#3{%
+ \let#3=\pgfutil@empty
+ \foreach \pgfplots@TMPB in {#1} {%
+ \pgfmathfloatparsenumber{\pgfplots@TMPB}%
+ \expandafter#2\expandafter{\pgfmathresult}%
+ \ifx#3\pgfutil@empty
+ \xdef#3{\pgfmathresult}%
+ \else
+ \xdef#3{#3,\pgfmathresult}%
+ \fi
+ }%
+ %
+}%
+
+% Helper method for
+% \pgfplots@apply@data@scale@trafo@to@options@for
+% #1: the ticks ALREADY IN FLOAT FORMAT
+% #2: the trafo macro name
+% #3: the output macro name
+\long\def\pgfplots@apply@data@scale@trafo@to@user@ticks@isfloat#1#2\to#3{%
+ \let#3=\pgfutil@empty
+ \foreach \pgfplots@TMPB in {#1} {%
+ #2{\pgfplots@TMPB}%
+ \ifx#3\pgfutil@empty
+ \xdef#3{\pgfmathresult}%
+ \else
+ \xdef#3{#3,\pgfmathresult}%
+ \fi
+ }%
+ %
+}%
+
+% helper for \pgfplots@apply@data@scale@trafo@to@options@for.
+\def\pgfplots@compute@number@order@for@trafo@isdimen#1\tocount#2{%
+ \edef\pgfplots@TMP{\pgf@sys@tonumber{#1}}%
+ \pgfmathfloatparsenumber{\pgfplots@TMP}%
+ \expandafter\pgfmathfloat@decompose@E\pgfmathresult\relax#2
+ \advance#2 by1
+}
+
+% helper for \pgfplots@apply@data@scale@trafo@to@options@for.
+%
+\def\pgfplots@compute@number@order@for@trafo@isfloat#1\tocount#2{%
+ \expandafter\pgfmathfloat@decompose@E#1\relax#2
+ \advance#2 by1
+}
+
+% Initialises the data scale transformation and applies it to any
+% user specified options.
+%
+% PRECONDITION:
+% - all axis limits are available in float representation
+% - \pgfplots@set@default@size@options has been called before
+% POSTCONDITION:
+% - the scaling transformation is set up,
+% - all axis limits are transformed,
+% - any user input (like ticks and tick labels)
+% will reflect the changes.
+\def\pgfplots@apply@data@scale@trafo@to@options@for#1{%
+ % initialise data scale transformation
+ % T(x) = 10^{q-m} * x
+ %
+ \begingroup
+ \let\data@max@order=\c@pgf@counta
+ \let\data@cur@order=\c@pgf@countb
+ \let\data@dimen=\pgf@xa
+ \let\data@tmp=\pgf@xb
+ \let\data@dimen@order=\c@pgf@countc
+ \let\data@EXPONENT=\c@pgf@countd
+ \expandafter\let\expandafter\pgfplots@min@float\csname pgfplots@#1min\endcsname
+ \expandafter\let\expandafter\pgfplots@max@float\csname pgfplots@#1max\endcsname
+ \expandafter\let\expandafter\pgfplots@actual@trafo\csname pgfplots@datascaletrafo@#1\endcsname
+ %
+ % Step 1: compute 'm', the data order
+ \pgfplots@compute@number@order@for@trafo@isfloat
+ \pgfplots@min@float
+ \tocount\data@cur@order
+ %
+ \data@max@order=\data@cur@order
+ %
+ \pgfplots@compute@number@order@for@trafo@isfloat
+ \pgfplots@max@float
+ \tocount\data@cur@order
+ %
+ \ifnum\data@cur@order>\data@max@order
+ \data@max@order=\data@cur@order
+ \fi
+ %
+ % Step 2: compute 'q', the #1-size of the axis.
+ \expandafter\ifx\csname pgfplots@#1\endcsname\pgfutil@empty
+ % We have 'width' or 'height'.
+ %
+ % Use the order of these parameters.
+ \def\pgfplots@TMP{#1}%
+ \def\pgfplots@TMPB{x}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ \expandafter\data@dimen\pgfplots@width\relax
+ \else
+ \def\pgfplots@TMPB{y}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ \expandafter\data@dimen\pgfplots@height\relax
+ \fi
+ \fi
+ \pgfplots@compute@number@order@for@trafo@isdimen
+ \data@dimen
+ \tocount\data@dimen@order
+ % This here is to avoid inaccuracies in the final
+ % axis rectangle size, see \pgfplots@initsizes:
+ %\advance\data@dimen@order by-1
+ \else
+ % FIXME:
+ % we have either the 'x=1cm' or 'y=1cm' option!
+ % How should I initialise the trafo!?
+ \data@dimen@order=3
+ \fi
+ %
+%\message{Direction #1: data max order=\the\data@max@order; data dimen order=\the\data@dimen@order. }%
+ \data@EXPONENT=\data@dimen@order
+ \advance\data@EXPONENT by-\data@max@order
+ % Now, I introduce a loop which shall avoid cancellation of
+ % significant digits.
+ %
+ % Harmless Example:
+ % if we have data shift = -3 and
+ % max = 2e6, min = 1e6, then max-min = 1e6; T(max)-T(min) = 1e3 which is ok.
+ % In this case, the loop won't change anything.
+ %
+ % Critical Example:
+ % if we have data shift = -3 and
+ % max = 1980, min = 1930 then
+ % T(max) = 1.98 and T(min) = 1.93
+ % and thus T(max)-T(min) = 0.05 .
+ % Considering that this is the axis range
+ % in which tick labels and plot points need to be computed, we
+ % only have two or three digits left! That happens because the
+ % prefix '19' is common and is cancelled in the subtraction.
+ % Idea: while T(max)-T(min) < O(10^2) -> increase shift by +1
+ % (and make sure that T(max) < MAX_VALID_TEX_NUMBER).
+ %
+ \pgfplots@loop@CONTINUEtrue
+ \expandafter\edef\csname pgfplots@data@scale@trafo@SHIFT@#1\endcsname{0}%
+ \loop
+ \expandafter\edef\csname pgfplots@data@scale@trafo@EXPONENT@#1\endcsname{\the\data@EXPONENT}%
+ \pgfplots@actual@trafo{\pgfplots@min@float}%
+ \let\pgfplots@min@fixed=\pgfmathresult
+ \ifpgfplots@loop@CONTINUE
+ \pgfplots@actual@trafo{\pgfplots@max@float}%
+ \let\pgfplots@max@fixed=\pgfmathresult
+ \expandafter\data@tmp\pgfplots@max@fixed pt
+%\message{Current trafo SHIFT for #1 direction: \the\data@EXPONENT; original #1 limits: [\pgfplots@min@float:\pgfplots@max@float]; current transformed #1 limits: [\pgfplots@min@fixed:\pgfplots@max@fixed]; cancellation check max-min running...}%
+ \ifdim\data@tmp<0pt
+ % I need absolute values here:
+ \multiply\data@tmp by-1\relax
+ \fi
+ \pgfplots@loop@CONTINUEfalse
+ \ifdim\data@tmp<1500pt% a multiplication with '10' results in max = 15000 which is the upper limit.
+ \pgfmathsubtract@{\pgfplots@max@fixed}{\pgfplots@min@fixed}%
+ \expandafter\data@dimen\pgfmathresult pt
+ \ifdim\data@dimen<100pt% I guess if max-min = O(100), we have quite good accuracy
+ \ifdim\data@dimen<0.0001pt
+ \else
+ \advance\data@EXPONENT by1
+ \pgfplots@loop@CONTINUEtrue
+ \fi
+ \fi
+ \fi
+ \repeat
+ \xdef\pgfplots@TMP{\csname pgfplots@data@scale@trafo@EXPONENT@#1\endcsname}%
+ \xdef\pgfplots@TMPB{\pgfplots@min@fixed}%
+ \endgroup
+%\message{Initialising the data scale transformation in direction #1 to 10^\pgfplots@TMP*#1 - \pgfplots@TMPB...}%
+ % COMPLETE INITIALISATION:
+ \ifpgfplots@EMERGENCY@FORCE@DATA@TRAFO@TO@IDENTITY
+ \pgfplots@warning{WARNING: the automatic scaling of input data has been DISABLED to allow unscalable commands. DISABLING THE DATA SCALING LIMITS THE DATA RANGE! I hope I can fix this issue as soon as possible. Please take a look at the manual for more information. If you get 'OVERFLOW' or 'UNDERFLOW' errors, you may need to disable the axispath.}%
+ \def\pgfplots@TMP{0}%
+ \def\pgfplots@TMPB{0}%
+ \fi
+ \expandafter\let\csname pgfplots@data@scale@trafo@EXPONENT@#1\endcsname\pgfplots@TMP
+ \expandafter\let\csname pgfplots@data@scale@trafo@SHIFT@#1\endcsname\pgfplots@TMPB%
+ %
+ % ... and apply transformation to any user input
+ %
+ % Transform axis limits:
+%\message{#1-limits BEFORE data transformation: [\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname]}%
+ \expandafter\expandafter\csname pgfplots@datascaletrafo@#1\endcsname\expandafter{\csname pgfplots@#1min\endcsname}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult
+ %
+ \expandafter\expandafter\csname pgfplots@datascaletrafo@#1\endcsname\expandafter{\csname pgfplots@#1max\endcsname}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult
+%\message{#1-limits after data transformation: [\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname]}%
+ %
+ % Convert any user-specified ticks:
+ \edef\pgfplots@TMP{\csname pgfplots@#1tick\endcsname}%
+ % this here should also work with 'xtick=\pgfutil@empty', the "No tick" command.
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \pgfplots@toka=\expandafter{\csname pgfplots@datascaletrafo@#1\endcsname}%
+ \def\pgfplots@TMPB{data}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ % we have #1tick = data
+ %
+ % Since we have entered this method, we know that these
+ % coordinate ARE ALREADY in floating point representation.
+ \expandafter\let\expandafter\pgfplots@TMP\csname pgfplots@firstplot@coords@#1\endcsname
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@TMP}%
+ \edef\pgfplots@TMP{{\the\pgfplotslist@TOK@a}\the\pgfplots@toka}%
+ \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks@isfloat\pgfplots@TMP\to\pgfplots@TMPC
+ \else
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@TMP}%
+%\message{Converting #1tick='\csname pgfplots@#1tick\endcsname'}%
+ \edef\pgfplots@TMP{{\the\pgfplotslist@TOK@a}\the\pgfplots@toka}%
+ \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks\pgfplots@TMP\to\pgfplots@TMPC
+ \fi
+ \expandafter\let\csname pgfplots@#1tick\endcsname=\pgfplots@TMPC
+ \fi
+ %
+ % Convert any extra-ticks, see above.
+ \edef\pgfplots@TMP{\csname pgfplots@extra@#1tick\endcsname}%
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \pgfplots@toka=\expandafter{\csname pgfplots@datascaletrafo@#1\endcsname}%
+ \edef\pgfplots@TMP{{\csname pgfplots@extra@#1tick\endcsname}\the\pgfplots@toka}%
+ \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks\pgfplots@TMP\to\pgfplots@TMPC
+ \expandafter\let\csname pgfplots@extra@#1tick\endcsname=\pgfplots@TMPC
+ \fi
+ %
+ % Transform any explicit axis unit scalings:
+ \expandafter\ifx\csname pgfplots@#1\endcsname\pgfutil@empty
+ \else
+%\message{Converting #1 unit scale='\csname pgfplots@#1\endcsname' ... }%
+ \expandafter\pgfmathparse\expandafter{\csname pgfplots@#1\endcsname}%
+ \expandafter\expandafter\csname pgfplots@inverse@datascaletrafo@tofixed@#1@noshift\endcsname\expandafter{\pgfmathresult}%
+ \expandafter\edef\csname pgfplots@#1\endcsname{\pgfmathresult pt}%
+%\message{to #1='\csname pgfplots@#1\endcsname'.}%
+ \fi
+}
+
+\newif\ifpgfplots@determinedefaultvalues@xisuniform
+\newif\ifpgfplots@determinedefaultvalues@yisuniform
+\newif\ifpgfplots@determinedefaultvalues@needs@check@uniformtick
+
+\def\pgfplots@determinedefaultvalues{%
+ \ifpgfplots@limits@are@computed
+ \else
+ % EMPTY AXIS:
+ \pgfplots@warning{WARNING: You have a plot with empty range. This may produce errors!}%
+ \fi
+ %
+ \pgfplots@set@default@size@options
+ %
+ \ifpgfplots@apply@datatrafo@x
+ \let\pgfplots@xmin@unscaled@as@float=\pgfplots@xmin
+ \let\pgfplots@xmax@unscaled@as@float=\pgfplots@xmax
+ \pgfplots@apply@data@scale@trafo@to@options@for x%
+ \else
+ \def\pgfplots@TMPB{data}%
+ \ifx\pgfplots@xtick\pgfplots@TMPB
+ \let\pgfplots@xtick=\pgfplots@firstplot@coords@x
+ \fi
+ \let\pgfplots@xmin@unscaled@as@float=\pgfutil@empty
+ \let\pgfplots@xmax@unscaled@as@float=\pgfutil@empty
+ \fi
+ \ifpgfplots@apply@datatrafo@y
+ \let\pgfplots@ymin@unscaled@as@float=\pgfplots@ymin
+ \let\pgfplots@ymax@unscaled@as@float=\pgfplots@ymax
+ \pgfplots@apply@data@scale@trafo@to@options@for y%
+ \else
+ \def\pgfplots@TMPB{data}%
+ \ifx\pgfplots@ytick\pgfplots@TMPB
+ \let\pgfplots@ytick=\pgfplots@firstplot@coords@y
+ \fi
+ \let\pgfplots@ymin@unscaled@as@float=\pgfutil@empty
+ \let\pgfplots@ymax@unscaled@as@float=\pgfutil@empty
+ \fi
+ \pgfplots@datascaletrafo@initialisedtrue
+ %
+ % From now on, we can always work with pgfmath.
+ % We simply need to apply the data scaling trafo before doing so.
+ \pgfplots@float@numerics@mode@xfalse
+ \pgfplots@float@numerics@mode@yfalse
+ %
+ \pgfkeysgetvalue{/pgfplots/minor x tick num}\pgfplots@minor@xtick@num
+ \pgfkeysgetvalue{/pgfplots/minor y tick num}\pgfplots@minor@ytick@num
+ \ifpgfplots@xislinear
+ \ifnum\pgfplots@minor@xtick@num=0\relax
+ \pgfplots@xminorticksfalse
+ \pgfplots@xminorgridsfalse
+ \else
+ \pgfplots@xminortickstrue
+ \fi
+ \fi
+ \ifpgfplots@yislinear
+ \ifnum\pgfplots@minor@ytick@num=0\relax
+ \pgfplots@yminorticksfalse
+ \pgfplots@yminorgridsfalse
+ \else
+ \pgfplots@yminortickstrue
+ \fi
+ \fi
+ %
+ \pgfplots@init@enlarge@limit@booleans
+ \ifpgfplots@enlargelimits
+ % relax the sizes.
+ %
+ % Idea: if the user chose his xmin,xmax tight to his data,
+ % this here will look better.
+ \pgfplots@enlarge@limit@for x
+ \pgfplots@enlarge@limit@for y
+ \else
+ \ifpgfplots@enlargelimits@auto
+ \ifpgfplots@hide
+ % there is no axis, so skip this enlargement (unless
+ % the user explizitly requests it)
+ \else
+ % FIXME : this here should be user-configurable!
+ \ifpgfplots@autocompute@xlim
+ \pgfplots@enlarge@limit@for x
+ \fi
+ \ifpgfplots@autocompute@ylim
+ \pgfplots@enlarge@limit@for y
+ \fi
+ \fi
+ \fi
+ \fi
+ %
+ \pgfplots@avoid@empty@axis@range@for x%
+ \pgfplots@avoid@empty@axis@range@for y%
+ %
+ \pgfplots@initsizes
+ %
+ \pgfplots@determinedefaultvalues@xisuniformtrue
+ \pgfplots@determinedefaultvalues@yisuniformtrue
+ \pgfplots@determinedefaultvalues@needs@check@uniformticktrue
+ \ifx\pgfplots@xtick\pgfutil@empty
+ \pgfplots@assign@default@tick@foraxis{x}%
+ \fi
+ \ifpgfplots@determinedefaultvalues@needs@check@uniformtick
+ \ifpgfplots@xislinear
+ \expandafter\pgfplots@checkisuniformLINEARtick\expandafter{\pgfplots@xtick}%
+ \ifpgfplots@isuniformtick
+ \pgfplots@determinedefaultvalues@xisuniformtrue
+ \else
+ \pgfplots@determinedefaultvalues@xisuniformfalse
+ \fi
+ \else
+ \expandafter\pgfplots@checkisuniformLOGtick\expandafter{\pgfplots@xtick}%
+ \ifpgfplots@isuniformtick
+ \pgfplots@determinedefaultvalues@xisuniformtrue
+ \else
+ \pgfplots@determinedefaultvalues@xisuniformfalse
+ \fi
+ \fi
+ \fi
+ \ifpgfplots@determinedefaultvalues@xisuniform
+ \else
+ \pgfplots@xminorticksfalse
+ \fi
+ %
+ %
+ %
+ \pgfplots@determinedefaultvalues@needs@check@uniformticktrue
+ \ifx\pgfplots@ytick\pgfutil@empty
+ \pgfplots@assign@default@tick@foraxis{y}%
+ \fi
+ \ifpgfplots@determinedefaultvalues@needs@check@uniformtick
+ \ifpgfplots@yislinear
+ \expandafter\pgfplots@checkisuniformLINEARtick\expandafter{\pgfplots@ytick}%
+ \ifpgfplots@isuniformtick
+ \pgfplots@determinedefaultvalues@yisuniformtrue
+ \else
+ \pgfplots@determinedefaultvalues@yisuniformfalse
+ \fi
+ \else
+ \expandafter\pgfplots@checkisuniformLOGtick\expandafter{\pgfplots@ytick}%
+ \ifpgfplots@isuniformtick
+ \pgfplots@determinedefaultvalues@yisuniformtrue
+ \else
+ \pgfplots@determinedefaultvalues@yisuniformfalse
+ \fi
+ \fi
+ \fi
+ \ifpgfplots@determinedefaultvalues@yisuniform
+ \else
+ \pgfplots@yminorticksfalse
+ \fi
+ %
+ \ifx\pgfplots@xticklabel\pgfutil@empty
+ \ifpgfplots@xislinear
+ \def\pgfplots@xticklabel{\axisdefaultticklabel}%
+ \else
+ \def\pgfplots@xticklabel{\axisdefaultticklabellog}%
+ \fi
+ \fi
+ \ifx\pgfplots@extra@xticklabel\pgfutil@empty
+ \let\pgfplots@extra@xticklabel=\pgfplots@xticklabel
+ \fi
+ \ifx\pgfplots@yticklabel\pgfutil@empty
+ \ifpgfplots@yislinear
+ \def\pgfplots@yticklabel{\axisdefaultticklabel}%
+ \else
+ \def\pgfplots@yticklabel{\axisdefaultticklabellog}%
+ \fi
+ \fi
+ \ifx\pgfplots@extra@yticklabel\pgfutil@empty
+ \let\pgfplots@extra@yticklabel=\pgfplots@yticklabel
+ \fi
+ %
+ %
+ \pgfplots@prepare@ZERO@coordinates
+}
+
+% This code is mainly interesting for bar plots.
+%
+% It precomputes x = 0 and y = 0 - which is not necessarily
+% trivial in case of data scaling. Furthermore, it applies
+% coordinate clipping to the resulting values and multiplies them
+% with x- and y scale vectors.
+\def\pgfplots@prepare@ZERO@coordinates{%
+ \ifpgfplots@apply@datatrafo@x
+ \pgfplots@datascaletrafo@fromfixed@x{0}%
+ \global\let\pgfplots@ZERO@x=\pgfmathresult
+ \else
+ \gdef\pgfplots@ZERO@x{0}%
+ \fi
+ \pgfmathmax@{\pgfplots@ZERO@x}{\pgfplots@xmin}%
+ \global\let\pgfplots@ZERO@x=\pgfmathresult
+ %
+ \ifpgfplots@apply@datatrafo@y
+ \pgfplots@datascaletrafo@fromfixed@y{0}%
+ \global\let\pgfplots@ZERO@y=\pgfmathresult
+ \else
+ \gdef\pgfplots@ZERO@y{0}%
+ \fi
+ \pgfmathmax@{\pgfplots@ZERO@y}{\pgfplots@ymin}%
+ \global\let\pgfplots@ZERO@y=\pgfmathresult
+ \pgfinterruptboundingbox%
+ \pgfpointxy{\pgfplots@ZERO@x}{\pgfplots@ZERO@y}%
+ \xdef\pgfplots@ZERO@x{\the\pgf@x}%
+ \xdef\pgfplots@ZERO@y{\the\pgf@y}%
+ \endpgfinterruptboundingbox%
+}%
+
+
+% Helper method for initsizes.
+%
+% It computes a scaling such that \pgfplots@width = SCALE * ACTUAL WIDTH.
+%
+% The actual width is
+% c + x*(xmax-xmin)
+% based on
+% - x*xmax = \pgfplots@xcoordmaxTEX
+% - x*xmin = \pgfplots@xcoordminTEX
+% - c = estimated, a constant for the axis label/tick labels
+%
+% Arguments:
+% #1: the output argument for the SCALE.
+\def\pgfplots@initsizes@getXscale\into#1{%
+ \expandafter\pgfplots@tmpa\pgfplots@width\relax
+ % EXPECTED WIDTH = X = \pgfplots@width
+ % ACTUAL WIDTH = c + x * (xmax-xmin)
+ % where c is a CONSTANT (for the axis labels/tick labels).
+ % -> \pgfplots@tmpXscale = (X - c) / (x *(xmax-xmin))
+ %
+ % \pgfplots@tmpa := X-c:
+ \ifpgfplots@scale@only@axis
+ \else
+ \advance\pgfplots@tmpa by-45pt% FIXME determine 'c' correctly!
+ \fi
+ \ifdim\pgfplots@tmpa<0pt
+ \pgfplots@error{Error: Plot width `\pgfplots@width' is too small. This can't be realised while maintaining constant width for y-labels. Sorry, label width are only approximate. You will need to adjust your width.}%
+ \pgfplots@tmpa=0pt
+ \fi
+ % \pgfplots@tmpb := x*(xmax-xmin):
+ \pgfplots@tmpb=\pgfplots@xcoordmaxTEX
+ \advance\pgfplots@tmpb by-\pgfplots@xcoordminTEX
+ \pgfmathlog@invoke@expanded\pgfmathdivide@{%
+ {\pgf@sys@tonumber\pgfplots@tmpa}%
+ {\pgf@sys@tonumber\pgfplots@tmpb}%
+ }%
+ \let#1=\pgfmathresult
+%\pgfplots@message{pgfplots.sty: Computing 'x' such that 'width = c + x*(xmax-xmin)';
+% c=estimated,
+% width-c =\the\pgfplots@tmpa,
+% x*(xmax[=\the\pgfplots@xcoordmaxTEX] - xmin[=\the\pgfplots@xcoordminTEX)]) = \the\pgfplots@tmpb
+% -> x-scale =#1 }%
+}
+
+% The same as \pgfplots@initsizes@getXscale, just for the height.
+\def\pgfplots@initsizes@getYscale\into#1{%
+ \expandafter\pgfplots@tmpa\pgfplots@height\relax
+ % EXPECTED WIDTH = X = \pgfplots@width
+ % ACTUAL WIDTH = c + x * (xmax-xmin)
+ % where c is a CONSTANT (for the axis labels/tick labels).
+ % -> \pgfplots@tmpXscale = (X - c) / (x *(xmax-xmin))
+ %
+ % \pgfplots@tmpa := X-c:
+ \ifpgfplots@scale@only@axis
+ \else
+ \advance\pgfplots@tmpa by-45pt\relax% FIXME determine 'c' correctly!
+ \fi
+ \ifdim\pgfplots@tmpa<0pt
+ \pgfplots@error{Error: Plot height `\pgfplots@height' is too small. This can't be realised while maintaining constant height for x-labels. Sorry, label heights are only approximate. You will need to adjust your height.}%
+ \pgfplots@tmpa=0pt
+ \fi
+ % \pgfplots@tmpb := x*(xmax-xmin):
+ \pgfplots@tmpb=\pgfplots@ycoordmaxTEX
+ \advance\pgfplots@tmpb by-\pgfplots@ycoordminTEX
+ \pgfmathlog@invoke@expanded\pgfmathdivide@{%
+ {\pgf@sys@tonumber\pgfplots@tmpa}%
+ {\pgf@sys@tonumber\pgfplots@tmpb}%
+ }%
+ \let#1=\pgfmathresult
+%\pgfplots@message{pgfplots.sty: Computing 'y' such that 'height = c + y*(ymax-ymin)';
+% height=\pgfplots@height,
+% c=estimated,
+% height-c =\the\pgfplots@tmpa,
+% y*(ymax[=\the\pgfplots@ycoordmaxTEX] - ymin[=\the\pgfplots@ycoordminTEX)]) = \the\pgfplots@tmpb
+% -> y-scale =#1 }%
+}
+
+
+\newif\ifpgfplots@avoid@emptyrange@@range@is@approx@equal
+% Checks whether axis limits in coordinate #1 are approximately equal.
+%
+% If that is the case, force a non-zero width of the range.
+%
+\def\pgfplots@avoid@empty@axis@range@for#1{%
+ % Check if axis limits are empty:
+ \begingroup
+ \expandafter\let\expandafter\if@cur@is@scaled\csname ifpgfplots@apply@datatrafo@#1\endcsname
+ \expandafter\let\expandafter\min\csname pgfplots@#1min\endcsname
+ \expandafter\let\expandafter\max\csname pgfplots@#1max\endcsname
+ \let\min@d=\pgf@xa
+ \let\max@d=\pgf@xb
+ \let\diff=\pgf@xc
+ \expandafter\min@d\min pt
+ \expandafter\max@d\max pt
+ \diff=\max@d
+ \advance\diff by-\min@d
+ % FIXME : I need a RELATIVE check here!
+ % but: real number point division is expensive
+ \if@cur@is@scaled
+ % this here should be sufficient because the axis
+ % has absolute values of order O( 10^3 ) or so.
+ \ifdim\diff<0.01pt
+ \pgfplots@avoid@emptyrange@@range@is@approx@equaltrue
+ \fi
+ \else
+ % there is no data scaling, so I should be much more defensive
+ % with absolute thresholds...
+ \ifdim\diff<0.01pt
+ \pgfplots@avoid@emptyrange@@range@is@approx@equaltrue
+ \fi
+ \fi
+ \ifpgfplots@avoid@emptyrange@@range@is@approx@equal
+ \pgfplots@warning{WARNING: Axis range for axis #1 (transformed: [\min:\max]) is approximately equal; enlargeing it.}%
+ % the case \min ~= \max
+ %
+ % enlarge \max and shrink \min:
+ \ifdim\max@d<0pt
+ \ifdim\max@d<-1pt
+ \max@d=0.8\max@d
+ \min@d=1.2\min@d
+ \else
+ \advance\max@d by-1pt
+ \advance\min@d by1pt
+ \fi
+ \else
+ \ifdim\max@d>1pt
+ \max@d=1.2\max@d
+ \min@d=0.8\min@d
+ \else
+ \ifdim\max@d=0pt
+ \if@cur@is@scaled
+ % we can't simply add a constant in the
+ % transformed range.
+ %
+ % So: set limits to [-1,1] = [-1.0e0,+1.0e0]
+ \pgfmathfloatcreate{2}{1.0}{0}%
+ \csname pgfplots@datascaletrafo@#1\endcsname{\pgfmathresult}%
+ \let\min=\pgfmathresult
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \csname pgfplots@datascaletrafo@#1\endcsname{\pgfmathresult}%
+ \let\max=\pgfmathresult
+%\pgfplots@message{[trafo shift = \csname pgfplots@data@scale@trafo@EXPONENT@#1\endcsname; setting limits -1:1]}%
+ \expandafter\min@d\min pt
+ \expandafter\max@d\max pt
+ \else
+ \advance\max@d by1pt
+ \advance\min@d by-1pt
+ \fi
+ \else
+ \advance\max@d by1pt
+ \advance\min@d by-1pt
+ \fi
+ \fi
+ \fi
+ \xdef\pgfplots@TMP{\pgf@sys@tonumber{\min@d}}%
+ \xdef\pgfplots@TMPB{\pgf@sys@tonumber{\max@d}}%
+%\pgfplots@message{ -> #1 = \pgfplots@TMP : \pgfplots@TMPB;}%
+ \else
+ \global\let\pgfplots@TMP=\min%
+ \global\let\pgfplots@TMPB=\max%
+ \fi
+ \endgroup
+ \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfplots@TMP
+ \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfplots@TMPB
+}
+
+% PRECONDITION:
+% none
+% POSTCONDITION:
+% \pgfplots@default@aspect@ratio is set.
+\def\pgfplots@compute@default@aspect@ratio{%
+ \expandafter\pgfmath@x\axisdefaultwidth
+ \expandafter\pgfmath@y\axisdefaultheight
+ \pgfmathlog@invoke@expanded\pgfmathdivide@{%
+ {\pgf@sys@tonumber{\pgfmath@x}}%
+ {\pgf@sys@tonumber{\pgfmath@y}}%
+ }%
+ \let\pgfplots@default@aspect@ratio=\pgfmathresult
+}
+
+\def\pgfplots@set@default@size@options{%
+ % The axes 'x' and 'y' vectors will be scaled such that the total
+ % size is (\axisdefaultwidth, \axisdefaultheight).
+ %
+ % If the user specifies ONE of width OR height,
+ % the plot will be resized; keeping the aspect ratio.
+ %
+ \let\pgfplots@default@aspect@ratio=\pgfutil@empty
+ % CASES:
+ % hasx := 'x' option non-empty
+ % hasy := 'y' option non-empty
+ % W := 'width' option non-empty
+ % H := 'height' option non-empty
+ %
+ % hasx = 1 -> width is not interesting; we use 'x' option.
+ % hasx = 0 -> determine final width:
+ % W H
+ % 0 0 -> \axisdefaultwidth
+ % 0 1 -> determine width out of H and the default aspect ratio
+ % 1 X -> ok, use the user parameter.
+ %
+ % hasy = 1 -> height is not interesting, we use 'y' option.
+ % hasy = 0 -> determine final height:
+ % W H
+ % 0 0 -> \axisdefaultheight
+ % X 1 -> ok, use the user parameter
+ % 1 0 -> determine height out of W and the default aspect ratio
+ %
+ \ifx\pgfplots@x\pgfutil@empty
+ \ifx\pgfplots@y\pgfutil@empty
+ % hasx=0, hasy=0
+ %
+ % -> KEEP ASPECT RATIO if just one W, or H is given!
+ \ifx\pgfplots@width\pgfutil@empty
+ \ifx\pgfplots@height\pgfutil@empty
+ % The case hasx=0, hasy=0, W=0 H=0:
+ \let\pgfplots@width=\axisdefaultwidth
+ \let\pgfplots@height=\axisdefaultheight
+ \else
+ % The case hasx=0, hasy=0, W=0 H=1:
+ \pgfplots@compute@default@aspect@ratio
+ \expandafter\pgfmath@y\pgfplots@height
+ \pgfmathlog@invoke@expanded\pgfmathmultiply@{%
+ {\pgf@sys@tonumber{\pgfmath@y}}%
+ {\pgfplots@default@aspect@ratio}%
+ }%
+ \edef\pgfplots@width{\pgfmathresult pt}%
+ \fi
+ \else
+ \ifx\pgfplots@height\pgfutil@empty
+ % The case hasx=0, hasy=0, W=1 H=0:
+ \pgfplots@compute@default@aspect@ratio
+ \expandafter\pgfmath@x\pgfplots@width
+ \pgfmathlog@invoke@expanded\pgfmathdivide@{%
+ {\pgf@sys@tonumber{\pgfmath@x}}%
+ {\pgfplots@default@aspect@ratio}%
+ }%
+ \edef\pgfplots@height{\pgfmathresult pt}%
+ \else
+ % The case hasx=0, hasy=0, W=1 H=1:
+ \fi
+ \fi
+ \else
+ % hasx=0, hasy=1, W=0:
+ \ifx\pgfplots@width\pgfutil@empty
+ \let\pgfplots@width=\axisdefaultwidth
+ \fi
+ \fi
+ \else
+ \ifx\pgfplots@y\pgfutil@empty
+ % hasx=1, hasy=0, H=0
+ \ifx\pgfplots@height\pgfutil@empty
+ \let\pgfplots@height=\axisdefaultheight
+ \fi
+ \fi
+ \fi
+}
+
+% PRECONDITION:
+% - final axis limits are given in transformed range
+% - \pgfplots@set@default@size@options has been invoked before
+% POSTCONDITION:
+% - the current x- and y unit vectors are changed;
+% - \pgfplots@[xy]coord{min,max}TEX are set
+%
+\def\pgfplots@initsizes{%
+ % INIT.
+ %
+ %
+ \pgfpointxy{\pgfplots@xmin}{\pgfplots@ymin}%
+ \pgfplots@xcoordminTEX=\pgf@x
+ \pgfplots@ycoordminTEX=\pgf@y
+ \pgfpointxy{\pgfplots@xmax}{\pgfplots@ymax}%
+ \pgfplots@xcoordmaxTEX=\pgf@x
+ \pgfplots@ycoordmaxTEX=\pgf@y
+ %
+ %
+ %-----------------------------------------
+ % PROCESS THE 'width' and 'height' options
+ %-----------------------------------------
+ %
+ % FIXME: make these variables LOCAL:
+ %
+ \let\pgfplots@rectangle@width=\pgfutil@empty
+ \let\pgfplots@rectangle@height=\pgfutil@empty
+ %
+ \ifx\pgfplots@x\pgfutil@empty
+ \ifx\pgfplots@width\pgfutil@empty
+ \pgfplots@error{INTERNAL LOGIC ERROR! WIDTH NOT SET}%
+ \fi
+ \pgfplots@initsizes@getXscale\into\pgfplots@tmpXscale
+ \ifpgfplots@scale@only@axis
+ \let\pgfplots@rectangle@width=\pgfplots@width
+ \fi
+ \else
+ \def\pgfplots@tmpXscale{1}%
+ \fi
+ %
+ \ifx\pgfplots@y\pgfutil@empty
+ \ifx\pgfplots@height\pgfutil@empty
+ \pgfplots@error{INTERNAL LOGIC ERROR! HEIGHT NOT SET}%
+ \fi
+ \pgfplots@initsizes@getYscale\into\pgfplots@tmpYscale
+ \ifpgfplots@scale@only@axis
+ \let\pgfplots@rectangle@height=\pgfplots@height
+ \fi
+ \else
+ \def\pgfplots@tmpYscale{1}%
+ \fi
+ %
+ %
+ % assert( \pgfplots@tmpXscale != \pgfutil@empty && \pgfplots@tmpYscale != \pgfutil@empty )
+ %
+ % Apply scaling:
+ \pgfpointxy{\pgfplots@tmpXscale}{\pgfplots@tmpYscale}%
+ \pgfplots@tmpa=\pgf@x
+ \pgfplots@tmpb=\pgf@y
+%\message{initscaling: got x-scaling \the\pgfplots@tmpa, and y-scaling \the\pgfplots@tmpb}%
+ \ifx\pgfplots@x\pgfutil@empty
+ \pgfsetxvec{\pgfqpoint{\pgfplots@tmpa}{0pt}}%
+ \else
+ \pgfsetxvec{\pgfpoint{\pgfplots@x}{0pt}}%
+ \fi
+ \ifx\pgfplots@y\pgfutil@empty
+ \pgfsetyvec{\pgfqpoint{0pt}{\pgfplots@tmpb}}%
+ \else
+ \pgfsetyvec{\pgfpoint{0pt}{\pgfplots@y}}%
+ \fi
+ %
+ % Determine final rectangle dimensions.
+ % There are the following cases:
+ % 1. the user really wants a fixed dimension,
+ % i.e. he used 'scale only axis'.
+ % Then, we have to work to get the correct dimension!
+ %
+ % Up to now, the scaling mechanism looses to many significant
+ % digits such that the final width/height differs by 1-2 pt.
+ %
+ % If I am not mistaken, this does ONLY affect the final size,
+ % not the relative plot precision.
+ %
+ % FIXME : really compute the plot precision!
+ %
+ % 2. The use specified width and/or height, but not 'scale only
+ % axis'. Accept inaccurate final widths/heights (see above).
+ %
+ % 3. The user supplied 'x' and or 'y'. Simply use them, its
+ % accurate.
+ %
+ \pgfpointxy{\pgfplots@xmin}{\pgfplots@ymin}%
+ \pgfplots@xcoordminTEX=\pgf@x
+ \pgfplots@ycoordminTEX=\pgf@y
+ \pgfpointxy{\pgfplots@xmax}{\pgfplots@ymax}%
+ \ifx\pgfplots@rectangle@width\pgfutil@empty
+ \pgfplots@xcoordmaxTEX=\pgf@x
+ \else
+ % this 'if' here should only make a difference of about
+ % 1-2pt, not more.
+ %
+ % and I am quite sure that this inaccuracy (and this
+ % work-around) only affects the
+ % final size, not the relative plot accuracy.
+ \pgfplots@xcoordmaxTEX=\pgfplots@xcoordminTEX
+ \expandafter\advance\expandafter\pgfplots@xcoordmaxTEX\pgfplots@width
+ \fi
+ \ifx\pgfplots@rectangle@height\pgfutil@empty
+ \pgfplots@ycoordmaxTEX=\pgf@y
+ \else
+ \pgfplots@ycoordmaxTEX=\pgfplots@ycoordminTEX
+ \expandafter\advance\expandafter\pgfplots@ycoordmaxTEX\pgfplots@height
+ \fi
+%--------------------------------------------------
+% \begingroup
+% \pgf@x=\pgfplots@xcoordmaxTEX\advance\pgf@x by-\pgfplots@xcoordminTEX
+% \pgf@y=\pgfplots@ycoordmaxTEX\advance\pgf@y by-\pgfplots@ycoordminTEX
+% \message{Axis scaling x=\pgfplots@tmpXscale, y=\pgfplots@tmpYscale\ yields lower-left-corner (\pgfplots@xmin,\pgfplots@ymin) = (\the\pgfplots@xcoordminTEX,\the\pgfplots@ycoordminTEX) and upper right (\pgfplots@xmax,\pgfplots@ymax) = (\the\pgfplots@xcoordmaxTEX,\the\pgfplots@ycoordmaxTEX). Axis dimensions are width=\the\pgf@x, height=\the\pgf@y.}%
+% \endgroup
+%--------------------------------------------------
+}
+
+
+% This is the main axis shape.
+%
+% It has one node part, which is the complete image. It provides a lot
+% of anchors.
+\pgfdeclareshape{pgfplots@low@level@shape}{%
+ \savedanchor\upperrightcorner{
+ \pgf@x=\wd\pgfnodepartimagebox
+ \pgf@y=\ht\pgfnodepartimagebox
+ }%
+ \savedanchor\lowerleftinnercorner{%
+ \pgfpoint{\pgfplots@savedanchor@inner@lowerleft@x}{\pgfplots@savedanchor@inner@lowerleft@y}%
+ }%
+ \savedanchor\upperrightinnercorner{%
+ \pgfpoint{\pgfplots@savedanchor@inner@upperright@x}{\pgfplots@savedanchor@inner@upperright@y}%
+ }%
+ %
+ \nodeparts{image}%
+ \anchor{image}{%
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }%
+ %
+ \anchor{outer north}{%
+ \upperrightcorner
+ \pgf@x=.5\pgf@x
+ }%
+ \anchor{outer north east}{\upperrightcorner}%
+ \anchor{outer east}{%
+ \upperrightcorner
+ \pgf@y=.5\pgf@y
+ }%
+ \anchor{outer south east}{%
+ \upperrightcorner
+ \pgf@y=0pt
+ }%
+ \anchor{outer south}{%
+ \upperrightcorner
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt
+ }%
+ \anchor{outer south west}{%
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }%
+ \anchor{outer west}{%
+ \upperrightcorner
+ \pgf@x=0pt
+ \pgf@y=.5\pgf@y
+ }%
+ \anchor{outer north west}{%
+ \upperrightcorner
+ \pgf@x=0pt
+ }%
+ \anchor{outer center}{%
+ \upperrightcorner
+ \pgf@x=.5\pgf@x
+ \pgf@y=.5\pgf@y
+ }%
+ %
+ %
+ \anchor{center}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@x
+ \pgf@xb=\pgf@y
+ \upperrightinnercorner
+ \advance\pgf@xa by\pgf@x
+ \pgf@x=.5\pgf@xa
+ \advance\pgf@xb by\pgf@y
+ \pgf@y=.5\pgf@xb
+ }%
+ \anchor{north}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@x
+ \pgf@xb=\pgf@y
+ \upperrightinnercorner
+ \advance\pgf@xa by\pgf@x
+ \pgf@x=.5\pgf@xa
+ }%
+ \anchor{north east}{\upperrightinnercorner}%
+ \anchor{east}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@x
+ \pgf@xb=\pgf@y
+ \upperrightinnercorner
+ \advance\pgf@xb by\pgf@y
+ \pgf@y=.5\pgf@xb
+ }%
+ \anchor{south east}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@x
+ \pgf@xb=\pgf@y
+ \upperrightinnercorner
+ \pgf@y=\pgf@xb
+ }%
+ \anchor{south}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@x
+ \pgf@xb=\pgf@y
+ \upperrightinnercorner
+ \advance\pgf@xa by\pgf@x
+ \pgf@x=.5\pgf@xa
+ \pgf@y=\pgf@xb
+ }%
+ \anchor{south west}{\lowerleftinnercorner}%
+ \anchor{west}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@x
+ \pgf@xb=\pgf@y
+ \upperrightinnercorner
+ \pgf@x=\pgf@xa
+ \advance\pgf@xb by\pgf@y
+ \pgf@y=.5\pgf@xb
+ }%
+ \anchor{north west}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@x
+ \pgf@xb=\pgf@y
+ \upperrightinnercorner
+ \pgf@x=\pgf@xa
+ }%
+ %%
+ %%
+ \anchor{above north}{%
+ \upperrightcorner
+ \pgf@xa=\pgf@y
+ \lowerleftinnercorner
+ \pgf@xb=\pgf@x
+ \upperrightinnercorner
+ \advance\pgf@xb by\pgf@x
+ \pgf@x=.5\pgf@xb
+ \pgf@y=\pgf@xa
+ }%
+ \anchor{above north east}{%
+ \upperrightcorner
+ \pgf@xa=\pgf@y
+ \upperrightinnercorner
+ \pgf@y=\pgf@xa
+ }%
+ \anchor{right of north east}{%
+ \upperrightcorner
+ \pgf@xa=\pgf@x
+ \upperrightinnercorner
+ \pgf@x=\pgf@xa
+ }%
+ \anchor{right of east}{%
+ \upperrightcorner
+ \pgf@xa=\pgf@x
+ \upperrightinnercorner
+ \pgf@xb=\pgf@y
+ \lowerleftinnercorner
+ \advance\pgf@xb by\pgf@y
+ \pgf@x=\pgf@xa
+ \pgf@y=.5\pgf@xb
+ }%
+ \anchor{right of south east}{%
+ \upperrightcorner
+ \pgf@xa=\pgf@x
+ \lowerleftinnercorner
+ \pgf@x=\pgf@xa
+ }%
+ \anchor{below south east}{%
+ \upperrightinnercorner
+ \pgf@y=0pt
+ }%
+ \anchor{below south}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@x
+ \upperrightinnercorner
+ \pgf@y=0pt
+ \advance\pgf@xa by\pgf@x
+ \pgf@x=.5\pgf@xa
+ }%
+ \anchor{below south west}{%
+ \lowerleftinnercorner
+ \pgf@y=0pt
+ }%
+ \anchor{left of south west}{%
+ \lowerleftinnercorner
+ \pgf@x=0pt
+ }%
+ \anchor{left of west}{%
+ \lowerleftinnercorner
+ \pgf@xa=\pgf@y
+ \upperrightinnercorner
+ \advance\pgf@xa by\pgf@y
+ \pgf@y=.5\pgf@xa
+ \pgf@x=0pt
+ }%
+ \anchor{left of north west}{%
+ \upperrightinnercorner
+ \pgf@x=0pt
+ }%
+ \anchor{above north west}{%
+ \upperrightcorner
+ \pgf@xa=\pgf@y
+ \lowerleftinnercorner
+ \pgf@y=\pgf@xa
+ }%
+ %%
+ %%
+ %%
+ \anchorborder{%
+ % Call a function that computes a border point. Since this
+ % function will modify dimensions like \pgf@x, we must move them to
+ % other dimensions.
+ \@tempdima=\pgf@x
+ \@tempdimb=\pgf@y
+ \pgfpointborderrectangle%
+ {\pgfpoint{\@tempdima}{\@tempdimb}}%
+ {\pgfpointadd{\upperrightcorner}{\pgfpoint{\width}{\height}}}
+ }%
+ \backgroundpath{\pgfpathrectangle{\pgfpointorigin}{\upperrightcorner}}%
+ \foregroundpath{}%
+ \behindbackgroundpath{}%
+ \beforebackgroundpath{}%
+ \behindforegroundpath{}%
+ \beforeforegroundpath{}%
+}
+
+\def\pgfplots@BEGIN@init@and@draw@axis{%
+ \pgfplots@determinedefaultvalues
+ \setbox\pgfnodepartimagebox=\hbox\bgroup\bgroup
+ \pgfinterruptpicture
+ \tikzpicture[/pgfplots/every axis]%
+ %\pgfqkeys{/tikz}{every axis}%
+ % set baseline for sub-picture to default value.
+ % the baseline option will be applied to the OUTER picture.
+ \pgfsetbaseline{\pgf@picminy}%
+ %
+ \scope
+ \ifpgfplots@hide
+ \else
+ \pgfplots@drawaxis@lines
+ \expandafter\pgfplots@drawxaxis\expandafter{\pgfplots@xtick}%
+ \expandafter\pgfplots@draw@extra@ticks@for\expandafter x\expandafter{\pgfplots@extra@xtick}%
+ \expandafter\pgfplots@drawyaxis\expandafter{\pgfplots@ytick}%
+ \expandafter\pgfplots@draw@extra@ticks@for\expandafter y\expandafter{\pgfplots@extra@ytick}%
+ \fi
+ \clip
+ (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX)
+ rectangle (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX);
+}
+
+
+\def\pgfplots@END@init@and@draw@axis{%
+ \endscope%
+}
+
+% Writes output to \pgfplots@TMP
+\def\pgfplots@filter@input@ticks@with@log#1{%
+ \let\pgfplots@TMP=\pgfutil@empty
+ \foreach \pgfplots@TMPB in {#1} {%
+ \expandafter\pgfmathlog@\expandafter{\pgfplots@TMPB}%
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \xdef\pgfplots@TMP{\pgfmathresult}%
+ \else
+ \xdef\pgfplots@TMP{\pgfplots@TMP,\pgfmathresult}%
+ \fi
+ }%
+}
+
+\tikzdeclarecoordinatesystem{axis}{\pgfplots@evalute@tikz@coord@system@interface#1\pgfplots@coord@end}
+
+
+% Assigns \pgfmathresult := canvas coordinate (#2) for axis #1.
+\long\def\pgfplots@evalute@tikz@coord@system@interface@for#1#2{%
+ \expandafter\let\expandafter\if@datascaled@cur\csname ifpgfplots@apply@datatrafo@#1\endcsname
+ \csname ifpgfplots@#1islinear\endcsname
+ \if@datascaled@cur
+ \csname pgfplots@datascaletrafo@fromfixed@#1\endcsname{#2}%
+ \else
+ \def\pgfmathresult{#2}%
+ \fi
+ \else
+ \pgfmathlog@{#2}%
+ \fi
+}
+
+\long\def\pgfplots@evalute@tikz@coord@system@interface#1,#2\pgfplots@coord@end{%
+ \begingroup
+ \pgfplots@evalute@tikz@coord@system@interface@for{x}{#1}%
+ \let\pgfplots@evaluate@tikz@coord@x=\pgfmathresult
+ \pgfplots@evalute@tikz@coord@system@interface@for{y}{#2}%
+ \xdef\pgfplots@TMP{\pgfplots@evaluate@tikz@coord@x pt}%
+ \xdef\pgfplots@TMPB{\pgfmathresult pt}%
+ \endgroup
+ \pgfpointxy{\pgfplots@TMP}{\pgfplots@TMPB}%
+}
+
+% In case of (semi-) logplots, this command will
+% - assign a filter which invokes \pgfmathlog@{} for each coordinate
+% - replace any user-specified coordinate by its log.
+%
+% All subsequent commands will then work with logarithmic coordinates.
+%
+% @see pgfmathlog.sty for details about the implementation of log().
+%
+% PRECONDITION:
+% - The user input options have been set correctly,
+% - the option processing has not yet begun
+%
+% POSTCONDITION:
+% - any user input for log-axis has been replaced by its log
+% - coordinate filters to compute logs are installed
+%
+% See also:
+% \pgfplots@apply@data@scale@trafo@to@options@for
+\def\pgfplots@prepare@coord@filtering@for#1{%
+ \expandafter\def\csname pgfplots@prepare@#1coord\endcsname##1{%
+ \def\pgfmathresult{##1}%
+ }%
+ \pgfkeysgetvalue{/pgfplots/#1filter}\pgfplots@TMP
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \expandafter\let\csname pgfplots@#1filter@backwcompat\endcsname=\pgfplots@TMP
+ \pgfplots@toka={WARNING: /pgfplots/#1filter is deprecated. Please use /pgfplots/#1 filter/.code={\def\pgfmathresult{\#1}}}%
+ \pgfplots@warning{\the\pgfplots@toka}%
+ \pgfkeys{/pgfplots/#1 filter/.code={\csname pgfplots@#1filter@backwcompat\endcsname{##1}\to\pgfmathresult}}%
+ \fi
+ \csname pgfplots@float@numerics@mode@#1false\endcsname
+ \csname ifpgfplots@#1islinear\endcsname
+ \ifpgfplots@disabledatascaling
+ \csname pgfplots@apply@datatrafo@#1false\endcsname
+ \pgfplots@apply@datatrafofalse
+ \else
+ \csname pgfplots@apply@datatrafo@#1true\endcsname
+ \csname pgfplots@float@numerics@mode@#1true\endcsname
+ \pgfplots@apply@datatrafotrue
+ \fi
+ \ifpgfplots@apply@datatrafo
+ % Check for any existing axis limits:
+ \expandafter\let\expandafter\pgfplots@TMP\csname pgfplots@#1min\endcsname
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \expandafter\pgfmathfloatparsenumber\expandafter{\pgfplots@TMP}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult
+ \fi
+ \expandafter\let\expandafter\pgfplots@TMP\csname pgfplots@#1max\endcsname
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \expandafter\pgfmathfloatparsenumber\expandafter{\pgfplots@TMP}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult
+ \fi
+ \fi
+ \else
+ \ifpgfplots@disablelogfilter
+ \else
+ % any user-specified axis limits:
+ \expandafter\let\expandafter\pgfplots@TMP\csname pgfplots@#1min\endcsname
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \expandafter\pgfmathlog@\expandafter{\pgfplots@TMP}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult
+ \fi
+ \expandafter\let\expandafter\pgfplots@TMP\csname pgfplots@#1max\endcsname
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \expandafter\pgfmathlog@\expandafter{\pgfplots@TMP}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult
+ \fi
+ %
+ % any user specified axis ticks:
+ \expandafter\let\expandafter\pgfplots@TMP\csname pgfplots@#1tick\endcsname
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \def\pgfplots@TMPB{data}%
+ \ifx\pgfplots@TMP\pgfplots@TMPB
+ \else
+ \expandafter\pgfplots@filter@input@ticks@with@log\expandafter{\pgfplots@TMP}%
+ \expandafter\edef\csname pgfplots@#1tick\endcsname{\pgfplots@TMP}%
+ \fi
+ \fi
+ \expandafter\let\expandafter\pgfplots@TMP\csname pgfplots@extra@#1tick\endcsname
+ \ifx\pgfplots@TMP\pgfutil@empty
+ \else
+ \expandafter\pgfplots@filter@input@ticks@with@log\expandafter{\pgfplots@TMP}%
+ \expandafter\edef\csname pgfplots@extra@#1tick\endcsname{\pgfplots@TMP}%
+ \fi
+ %
+ \expandafter\def\csname pgfplots@prepare@#1coord\endcsname##1{%
+ \pgfmathlog@{##1}%
+ }%
+ %--------------------------------------------------
+ % \expandafter\let\expandafter\pgfplots@TMP\csname pgfplots@#1filter\endcsname
+ % \ifx\pgfplots@TMP\pgfutil@empty
+ % \expandafter\def\csname addplot@log@compute@#1filter\endcsname##1\to##2{%
+ % \pgfmathlog@{##1}%
+ % \let##2=\pgfmathresult
+ % }%
+ % \else
+ % \expandafter\let\csname pgfplots@#1filter@orig\endcsname=\pgfplots@TMP
+ % \expandafter\def\csname addplot@log@compute@#1filter\endcsname##1\to##2{%
+ % \pgfmathlog@{##1}%
+ % \ifx\pgfmathresult\pgfutil@empty
+ % \let##2=\pgfutil@empty
+ % \else
+ % \expandafter\expandafter\csname pgfplots@#1filter@orig\endcsname\pgfmathresult\to##2\relax
+ % \fi
+ % }%
+ % \fi
+ % \expandafter\let\expandafter\pgfplots@TMP\csname addplot@log@compute@#1filter\endcsname
+ % \expandafter\let\csname pgfplots@#1filter\endcsname\pgfplots@TMP
+ %--------------------------------------------------
+ \fi
+ \fi
+}
+
+\def\pgfplots@create@axis@descriptions{%
+ \ifpgfplots@hide
+ \else
+ \ifx\pgfplots@xlabel\pgfutil@empty
+ \else
+ \pgfplots@show@label{x}%
+ \fi
+ \ifx\pgfplots@ylabel\pgfutil@empty
+ \else
+ \pgfplots@show@label{y}%
+ \fi
+ \fi
+ \ifx\pgfplots@title\pgfutil@empty
+ \else
+ \pgfplots@show@title
+ \fi
+ \pgfplots@createlegend
+}
+
+\def\pgfplots@datascaletrafo@undoshift@x#1{%
+ \pgfmathsubtract@{#1}{\pgfplots@data@scale@trafo@SHIFT@x}%
+}%
+\def\pgfplots@datascaletrafo@redoshift@x#1{%
+ \pgfmathadd@{#1}{\pgfplots@data@scale@trafo@SHIFT@x}%
+}%
+\def\pgfplots@datascaletrafo@undoshift@y#1{%
+ \pgfmathsubtract@{#1}{\pgfplots@data@scale@trafo@SHIFT@y}%
+}%
+\def\pgfplots@datascaletrafo@redoshift@y#1{%
+ \pgfmathadd@{#1}{\pgfplots@data@scale@trafo@SHIFT@y}%
+}%
+
+% DATA TRANSFORMATION T(x) = X - xmin
+%
+% Input:
+% a number in the original data range, given in **floating** point representation
+% Output:
+% a fixed point number in transformed range
+% stored in \pgfmathresult
+% @see
+% \pgfplots@datascaletrafo@fromfixed@x
+\def\pgfplots@datascaletrafo@x#1{%
+ \pgfmathfloatshift{#1}{\pgfplots@data@scale@trafo@EXPONENT@x}%
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+ \expandafter\pgfmathsubtract@\expandafter{\pgfmathresult}{\pgfplots@data@scale@trafo@SHIFT@x}%
+}
+\def\pgfplots@datascaletrafo@x@noshift#1{%
+ \pgfmathfloatshift{#1}{\pgfplots@data@scale@trafo@EXPONENT@x}%
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+}
+
+% Overloaded function.
+% Input:
+% a FIXED point number instead of a floating point one.
+% @see \pgfplots@datascaletrafo@x
+\def\pgfplots@datascaletrafo@fromfixed@x#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfplots@datascaletrafo@x\expandafter{\pgfmathresult}%
+}
+
+\def\pgfplots@datascaletrafo@y#1{%
+ \pgfmathfloatshift{#1}{\pgfplots@data@scale@trafo@EXPONENT@y}%
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+ \expandafter\pgfmathsubtract@\expandafter{\pgfmathresult}{\pgfplots@data@scale@trafo@SHIFT@y}%
+}
+\def\pgfplots@datascaletrafo@fromfixed@y#1{%
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfplots@datascaletrafo@y\expandafter{\pgfmathresult}%
+}
+\def\pgfplots@datascaletrafo@y@noshift#1{%
+ \pgfmathfloatshift{#1}{\pgfplots@data@scale@trafo@EXPONENT@y}%
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+}
+
+% INVERSE transformation x = T^{-1}( X )
+% Input:
+% a fixed point number in transformed domain
+% Output:
+% a number in the data domain, given in floating point
+% representation
+%
+% If the input number is approximately X=0, we will return x=0 as
+% well.
+%
+% This allows to handle rounding inaccuracies and should not pose any
+% problems.
+\def\pgfplots@inverse@datascaletrafo@x#1{%
+ \begingroup
+ \pgfmathadd@{#1}{\pgfplots@data@scale@trafo@SHIFT@x}%
+ \let\pgfplots@inverse@datascaletrafo@@shifted=\pgfmathresult
+ \pgfmathapproxequalto@{\pgfplots@inverse@datascaletrafo@@shifted}{0.0}%
+ \ifpgfmathcomparison
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \else
+ \pgfmathfloatparsenumber{\pgfplots@inverse@datascaletrafo@@shifted}%
+ \edef\pgfplots@data@scale@trafo@EXPONENT@x{-\pgfplots@data@scale@trafo@EXPONENT@x}%
+ \expandafter\pgfmathfloatshift\expandafter{\pgfmathresult}{\pgfplots@data@scale@trafo@EXPONENT@x}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+\def\pgfplots@inverse@datascaletrafo@x@noshift#1{%
+ \begingroup
+ \pgfmathapproxequalto@{#1}{0.0}%
+ \ifpgfmathcomparison
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \else
+ \pgfmathfloatparsenumber{#1}%
+ \edef\pgfplots@data@scale@trafo@EXPONENT@x{-\pgfplots@data@scale@trafo@EXPONENT@x}%
+ \expandafter\pgfmathfloatshift\expandafter{\pgfmathresult}{\pgfplots@data@scale@trafo@EXPONENT@x}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+\def\pgfplots@inverse@datascaletrafo@y#1{%
+ \begingroup
+ \pgfmathadd@{#1}{\pgfplots@data@scale@trafo@SHIFT@y}%
+ \let\pgfplots@inverse@datascaletrafo@@shifted=\pgfmathresult
+ \pgfmathapproxequalto@{\pgfplots@inverse@datascaletrafo@@shifted}{0.0}%
+ \ifpgfmathcomparison
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \else
+ \pgfmathfloatparsenumber{\pgfplots@inverse@datascaletrafo@@shifted}%
+ \edef\pgfplots@data@scale@trafo@EXPONENT@y{-\pgfplots@data@scale@trafo@EXPONENT@y}%
+ \expandafter\pgfmathfloatshift\expandafter{\pgfmathresult}{\pgfplots@data@scale@trafo@EXPONENT@y}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+% Overloaded function. This one does only apply the scaling, no shift.
+\def\pgfplots@inverse@datascaletrafo@y@noshift#1{%
+ \begingroup
+ \pgfmathapproxequalto@{#1}{0.0}%
+ \ifpgfmathcomparison
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \else
+ \pgfmathfloatparsenumber{#1}%
+ \edef\pgfplots@data@scale@trafo@EXPONENT@y{-\pgfplots@data@scale@trafo@EXPONENT@y}%
+ \expandafter\pgfmathfloatshift\expandafter{\pgfmathresult}{\pgfplots@data@scale@trafo@EXPONENT@y}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}
+
+% Overloaded function.
+%
+% In contrast to \pgfplots@inverse@datascaletrafo@x, this method
+% returns a number in FIXED point representation.
+% @see \pgfplots@inverse@datascaletrafo@x
+\def\pgfplots@inverse@datascaletrafo@tofixed@x#1{%
+ \pgfplots@inverse@datascaletrafo@x{#1}%
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+}
+\def\pgfplots@inverse@datascaletrafo@tofixed@y#1{%
+ \pgfplots@inverse@datascaletrafo@y{#1}%
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+}
+
+% Overloaded function.
+%
+% This one does only apply the scale, no shift.
+\def\pgfplots@inverse@datascaletrafo@tofixed@x@noshift#1{%
+ \pgfplots@inverse@datascaletrafo@x@noshift{#1}%
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+}
+\def\pgfplots@inverse@datascaletrafo@tofixed@y@noshift#1{%
+ \pgfplots@inverse@datascaletrafo@y@noshift{#1}%
+ \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}%
+}
+
+% Parses all options in #1 which are known in the currently active families.
+%
+% The result will be stored back into the TikZ-style named #1 without
+% further processing.
+%
+% Example:
+% \tikzstyle{every axis}=[xmin=0,xmax=1,line width=1pt
+% \pgfplots@set@keys@from@tikz@style\tmpmacro{every axis}{/pgfplots}
+%
+% - sets axis options 'xmin' and 'xmax'
+% - calls \tikzstyle{every axis}={line width=1pt}
+%
+% I assume that this method is called within local TeX groups so
+% nothing will be destroyed outside.
+%
+% #1: A style name.
+\def\pgfplots@set@keys@from@tikz@style#1{%
+ \let\pgfplots@rmopts=\pgfutil@empty
+ \pgfqkeysfiltered{/pgfplots}{/pgfplots/#1}%
+ \pgfplots@set@keymacro@to@style\pgfplots@rmopts{#1}%
+}
+
+% The same as \pgfplots@set@keys@from@tikz@style but this one appends
+% unmatched options to style #2.
+%
+% #1: A style name.
+% #2: A style name which will be filled with unprocessed options.
+\def\pgfplots@set@keys@from@tikz@style@append@to#1#2{%
+ \let\pgfplots@rmopts=\pgfutil@empty
+ \pgfqkeysfiltered{/pgfplots}{/pgfplots/#1}%
+ \pgfplots@append@keymacro@to@style\pgfplots@rmopts{#2}%
+}
+
+% #1: A sequence of options.
+% #2: A style name which will be filled with unprocessed options.
+\def\pgfplots@set@keys@and@append@remaining@to@style#1#2{%
+ \let\pgfplots@rmopts=\pgfutil@empty
+ \pgfqkeysfiltered{/pgfplots}{#1}%
+ \pgfplots@append@keymacro@to@style\pgfplots@rmopts{#2}%
+}%
+
+% #1: input macro
+\def\pgfplots@setkeys@from@macro#1{%
+ \let\pgfplots@rmopts=\pgfutil@empty
+ \def\pgfplots@TMP{\pgfqkeysfiltered{/pgfplots}}%
+ \expandafter\pgfplots@TMP\expandafter{#1}%
+}
+
+% #1: macro
+% #2: style name
+\long\def\pgfplots@append@keymacro@to@style#1#2{%
+ \pgfplotslist@TOK@a={#2/.append style=}%
+ \pgfplotslist@TOK@b=\expandafter{#1}%
+ \edef\pgfplots@setkeys@TMP{\the\pgfplotslist@TOK@a{\the\pgfplotslist@TOK@b}}%
+ \expandafter\pgfplotsset\expandafter{\pgfplots@setkeys@TMP}%
+%\pgfplots@message{tikzstyle{#2}+=[#1]}%
+}
+
+% #1: macro
+% #2: style name
+\long\def\pgfplots@set@keymacro@to@style#1#2{%
+ \pgfplotslist@TOK@a={#2/.style=}%
+ \pgfplotslist@TOK@b=\expandafter{#1}%
+ \edef\pgfplots@setkeys@TMP{\the\pgfplotslist@TOK@a{\the\pgfplotslist@TOK@b}}%
+ \expandafter\pgfplotsset\expandafter{\pgfplots@setkeys@TMP}%
+%\pgfplots@message{tikzstyle{#2}=[#1]}%
+}
+
+\def\pgfplots@preset@keys{%
+ \def\pgfplots@at{\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
+}
+
+% backwards compatibility:
+\let\prettyprintnumber=\pgfmathprintnumber%
+
+\def\pgfplots@set@options#1{%
+ \pgfplots@preset@keys
+ %
+ % Temporarily assign families to 'name' and 'alias' options.
+ % This allows to get the names - they should not be appended to
+ % 'every axis'!
+ \pgfkeys{%
+ /tikz/domain/.belongs to family=/pgfplots,
+ /pgfplots/domain/.code={\pgfkeysalso{/tikz/domain=##1}},
+ /tikz/name/.belongs to family=/pgfplots/naming commands,
+ /tikz/alias/.belongs to family=/pgfplots/naming commands,
+ % and provide aliases in the '/pgfplots/' tree to avoid
+ % search path problems just for these two options:
+ /pgfplots/name/.belongs to family=/pgfplots/naming commands,
+ /pgfplots/alias/.belongs to family=/pgfplots/naming commands,
+ /pgfplots/name/.code={\pgfkeysalso{/tikz/name=##1}},
+ /pgfplots/alias/.code={\pgfkeysalso{/tikz/alias=##1}},
+ %
+ %
+ /pgf/key filter handlers/append filtered to/.install key filter handler=\pgfplots@rmopts,
+ }%
+ \let\tikz@alias=\pgfutil@empty
+ \let\tikz@fig@name=\pgfutil@empty
+ %
+ % Step 1: acquire ONLY 'xmode' and 'ymode' (necessary to decide
+ % which axis style shall be loaded):
+ \let\pgfplots@rmopts=\pgfutil@empty
+ \pgfkeysinstallkeyfilter
+ {/pgf/key filters/active families or no family}
+ {{/pgf/key filters/false}{/pgf/key filters/false}}
+ %
+ \pgfqkeysactivatesinglefamilyandfilteroptions{/pgfplots/scale}%
+ {/pgfplots}
+ {#1}%
+ \let\pgfplots@remaining@input=\pgfplots@rmopts
+ %
+ % Step 2: parse any pgfplots options out of styles.
+ \pgfkeysactivatefamily{/pgfplots/style commands}%
+ \pgfkeysinstallkeyfilter
+ {/pgf/key filters/active families or no family}% DEBUG}
+ {{/pgf/key filters/is descendant of=/pgfplots}% for keys without family
+ {/pgf/key filters/false}% for unknown keys
+ }%
+ %
+ \pgfkeysactivatefamilies
+ {/pgfplots,/pgfplots/naming commands,/pgfplots/tick,/pgfplots/legend,/pgfplots/descriptions,/pgfplots/scale}
+ {\pgfplots@deactivefamiliescmd}%
+ \pgfplots@set@keys@from@tikz@style{every axis}%
+ \pgfkeysdeactivatefamily{/pgfplots/scale}%
+ %
+ \ifpgfplots@xislinear
+ \ifpgfplots@yislinear
+ \pgfplots@set@keys@from@tikz@style@append@to{every linear axis}{every axis}%
+ \else
+ \pgfplots@set@keys@from@tikz@style@append@to{every semilogy axis}{every axis}%
+ \fi
+ \else
+ \ifpgfplots@yislinear
+ \pgfplots@set@keys@from@tikz@style@append@to{every semilogx axis}{every axis}%
+ \else
+ \pgfplots@set@keys@from@tikz@style@append@to{every loglog axis}{every axis}%
+ \fi
+ \fi
+ \pgfplots@deactivefamiliescmd
+ %
+ % Acquire style commands and nameing commands from direct input
+ % options '#1' BEFORE the 'every' styles are processed:
+ \pgfkeysactivatefamily{/pgfplots/naming commands}%
+ \pgfplots@setkeys@from@macro\pgfplots@remaining@input%
+ \let\pgfplots@remaining@input=\pgfplots@rmopts
+ \pgfkeysdeactivatefamily{/pgfplots/naming commands}%
+ %
+ % Now, any 'name' and 'alias' options have been processed.
+ %
+ % Remember their current meaning and reset the tikz options!
+ \let\pgfplots@fig@name=\tikz@fig@name
+ \let\pgfplots@fig@alias=\tikz@alias
+ \let\tikz@alias=\pgfutil@empty
+ \let\tikz@fig@name=\pgfutil@empty
+ %
+ % And protocol all named sub-nodes! Their positions need to be
+ % updated later.
+ \let\pgfplots@named@child@node@list=\pgfutil@empty
+ \pgfkeysgetvalue{/tikz/name/.@cmd}\pgfplots@old@name@impl
+ \pgfkeysgetvalue{/tikz/alias/.@cmd}\pgfplots@old@alias@impl
+ \pgfkeysdef{/tikz/name}{%
+ \xdef\pgfplots@named@child@node@list{\pgfplots@named@child@node@list,{##1}}%
+ \pgfplots@old@name@impl##1\pgfeov
+ }%
+ \pgfkeysdef{/tikz/alias}{%
+ \xdef\pgfplots@named@child@node@list{\pgfplots@named@child@node@list,{##1}}%
+ \pgfplots@old@alias@impl##1\pgfeov
+ }%
+ %
+ % Now, continue to process the 'every' styles. Please note that
+ % the 'legend style={}' like options have already been processed;
+ % their values are already inside of the associated 'every'
+ % styles.
+ %
+ % What I am doing here is: set every pgfplots-option directly, and
+ % discard it from the every-style. Any non-pgfplots-option will
+ % be set in its context.
+ %
+ \pgfkeysactivatefamily{/pgfplots/legend}%
+ \pgfplots@set@keys@from@tikz@style{every axis legend}%
+ \pgfkeysdeactivatefamily{/pgfplots/legend}%
+ %
+ %
+ \pgfkeysactivatefamily{/pgfplots/descriptions}%
+ \pgfplots@set@keys@from@tikz@style{every axis label}%
+ \pgfplots@set@keys@from@tikz@style{every axis x label}%
+ \pgfplots@set@keys@from@tikz@style{every axis y label}%
+ \pgfplots@set@keys@from@tikz@style{every axis title}%
+ \pgfkeysdeactivatefamily{/pgfplots/descriptions}%
+ %
+ \pgfkeysactivatefamily{/pgfplots/tick}%
+ \pgfplots@set@keys@from@tikz@style{every tick}%
+ \pgfplots@set@keys@from@tikz@style{every minor tick}%
+ \pgfplots@set@keys@from@tikz@style{every major tick}%
+ \pgfplots@set@keys@from@tikz@style{every axis grid}%
+ \pgfplots@set@keys@from@tikz@style{every minor grid}%
+ \pgfplots@set@keys@from@tikz@style{every major grid}%
+ \pgfkeysdeactivatefamily{/pgfplots/tick}%
+ %
+ \pgfkeysactivatefamily{/pgfplots}%
+ \pgfplots@set@keys@from@tikz@style{every axis plot}%
+ \pgfkeysdeactivatefamily{/pgfplots}%
+ %
+ \pgfkeysactivatefamily{/pgfplots/descriptions}%
+ \pgfkeysactivatefamily{/pgfplots/tick}%
+ \pgfplots@set@keys@from@tikz@style{every x tick label}%
+ \pgfplots@set@keys@from@tikz@style{every y tick label}%
+ \pgfplots@set@keys@from@tikz@style{every tick label}%
+ \pgfkeysdeactivatefamily{/pgfplots/tick}%
+ \pgfkeysdeactivatefamily{/pgfplots/descriptions}%
+ %
+ % Step 3: Set all remaining options of '#1'. They should have
+ % highest precedence.
+ \pgfkeysactivatefamilies
+ {/pgfplots,/pgfplots/tick,/pgfplots/legend,/pgfplots/descriptions}%
+ {\pgfplots@deactivefamiliescmd}%
+ \expandafter
+ \pgfplots@set@keys@and@append@remaining@to@style
+ \expandafter
+ {\pgfplots@remaining@input}%
+ {every axis}%
+ \pgfplots@deactivefamiliescmd
+%\pgfkeysgetvalue{/tikz/every axis/.@cmd}\pgfplots@TMP
+%\message{every axis is now '\meaning\pgfplots@TMP'}%
+ %
+ \pgfkeysdeactivatefamily{/pgfplots/style commands}%
+ \global\pgfkeysgetvalue{/pgfplots/xmin}{\pgfplots@xmin}%
+ \global\pgfkeysgetvalue{/pgfplots/xmax}{\pgfplots@xmax}%
+ \global\pgfkeysgetvalue{/pgfplots/ymin}{\pgfplots@ymin}%
+ \global\pgfkeysgetvalue{/pgfplots/ymax}{\pgfplots@ymax}%
+ %
+ \def\pgfplots@TMP{data}%
+ \pgfplots@collect@firstplot@astickfalse
+ \ifx\pgfplots@xtick\pgfplots@TMP
+ \pgfplots@collect@firstplot@asticktrue
+ \fi
+ \ifx\pgfplots@ytick\pgfplots@TMP
+ \pgfplots@collect@firstplot@asticktrue
+ \fi
+ \ifpgfplots@collect@firstplot@astick
+ \let\pgfplots@firstplot@coords@x=\pgfutil@empty
+ \let\pgfplots@firstplot@coords@y=\pgfutil@empty
+ \fi
+}
+
+\def\pgfplots@install@abbrev@commands{
+ \let\pgfplots@orig@path=\path
+ \let\pgfplots@orig@plot=\plot
+ %
+ \let\axispath=\pgfplots@path
+ %
+ \let\addplot=\pgfplots@addplot
+ \let\plot=\addplot
+ %
+ \def\logten{2.3025851}%
+ \def\reciproclogten{0.434294}%
+ %
+ \def\logi##1{%
+ \ifcase##1
+ \or0
+ \or0.693147
+ \or1.098612
+ \or1.386294
+ \or1.60943791
+ \or1.7917594
+ \or1.94591014
+ \or2.07944154
+ \or2.197224
+ \fi
+ }%
+ %
+ \let\legend=\pgfplots@command@legend
+ \let\addlegendentry=\pgfplots@addlegendentry
+}
+
+\def\pgfplots@environment{%
+ \pgfutil@ifnextchar[{%
+ \pgfplots@environment@opt
+ }{%
+ \pgfplots@environment@opt[]%
+ }%
+}%
+
+% temporary (local) variables inside of axis
+\newif\ifpgfplots@autocomputelimits
+\newif\ifpgfplots@autocompute@xlim
+\newif\ifpgfplots@autocompute@ylim
+\newif\ifpgfplots@apply@datatrafo@x
+\newif\ifpgfplots@apply@datatrafo@y
+\newif\ifpgfplots@apply@datatrafo
+\newif\ifpgfplots@float@numerics@mode@x
+\newif\ifpgfplots@float@numerics@mode@y
+\newif\ifpgfplots@datascaletrafo@initialised
+\newif\ifpgfplots@draw@at@end
+\newif\ifpgfplots@limits@are@computed
+\newif\ifpgfplots@EMERGENCY@FORCE@DATA@TRAFO@TO@IDENTITY
+
+% Extracts single components of an entry of
+% \pgfplots@stored@plotlist
+%
+% They are defined as
+% \pgfplots@stored@current@precmd
+% \pgfplots@stored@current@cmd
+% \pgfplots@stored@current@data
+% \pgfplots@stored@current@postcmd
+\def\pgfplots@stored@plotlist@EXTRACTENTRY#1#2#3#4{%
+ \def\pgfplots@stored@current@precmd{#1}%
+ \def\pgfplots@stored@current@cmd{#2}%
+ \def\pgfplots@stored@current@data{#3}%
+ \def\pgfplots@stored@current@postcmd{#4}%
+}
+
+\def\pgfplots@environment@opt[#1]{%
+ \begingroup
+ \pgfplots@install@abbrev@commands
+ \pgfplots@stacked@initialise
+ %
+ %
+ % The explicit specification of 'x' and 'y' as 1pt is to avoid
+ % numeric overflow/underflow during scale computations:
+ %
+ % The scaling (i.e. proper values for 'x' and 'y') will be
+ % determined later-on, dependend on the axis limits. Since axis
+ % limits are implicitly in units of 1pt, it is reasonable to use
+ % '1pt' here as well.
+ \pgfsetxvec{\pgfqpoint{1pt}{0pt}}%
+ \pgfsetyvec{\pgfqpoint{0pt}{1pt}}%
+ %
+ \pgfplots@set@options{#1}%
+ %
+ % --------------------
+ % Allocations:
+ % --------------------
+ \global\pgfplots@EMERGENCY@FORCE@DATA@TRAFO@TO@IDENTITYfalse
+ \global\pgfplotslistnewempty\pgfplots@plotspeclist
+ \global\pgfplotslistnewempty\pgfplots@legend
+ \global\pgfplotslistnewempty\pgfplots@stored@plotlist
+ \global\pgfplots@numplots=0
+ \let\pgfplots@already@computed@legend@node=\pgfutil@empty
+ %
+ % --------------------
+ % Option preprocessing
+ % --------------------
+ \pgfplots@prepare@coord@filtering@for x
+ \pgfplots@prepare@coord@filtering@for y
+ \ifpgfplots@apply@datatrafo
+ \pgfplots@datascaletrafo@initialisedfalse
+ \else
+ \pgfplots@datascaletrafo@initialisedtrue% there is no trafo.
+ \fi
+ %
+ \ifx\pgfplots@xmin\pgfutil@empty
+ \pgfplots@autocompute@xlimtrue
+ \gdef\pgfplots@xmin{16300}%
+ \ifpgfplots@float@numerics@mode@x
+ \pgfmathfloatcreate{1}{1.0}{324}%
+ \global\let\pgfplots@xmin=\pgfmathresult
+ \fi
+ \fi
+ \ifx\pgfplots@xmax\pgfutil@empty
+ \pgfplots@autocompute@xlimtrue
+ \gdef\pgfplots@xmax{-16300}%
+ \ifpgfplots@float@numerics@mode@x
+ \pgfmathfloatcreate{2}{1.0}{324}%
+ \global\let\pgfplots@xmax=\pgfmathresult
+ \fi
+ \fi
+ \ifx\pgfplots@ymin\pgfutil@empty
+ \pgfplots@autocompute@ylimtrue
+ \gdef\pgfplots@ymin{16300}%
+ \ifpgfplots@float@numerics@mode@y
+ \pgfmathfloatcreate{1}{1.0}{324}%
+ \global\let\pgfplots@ymin=\pgfmathresult
+ \fi
+ \fi
+ \ifx\pgfplots@ymax\pgfutil@empty
+ \pgfplots@autocompute@ylimtrue
+ \gdef\pgfplots@ymax{-16300}%
+ \ifpgfplots@float@numerics@mode@y
+ \pgfmathfloatcreate{2}{1.0}{324}%
+ \global\let\pgfplots@ymax=\pgfmathresult
+ \fi
+ \fi
+ %
+ \global\pgfplots@limits@are@computedtrue
+ \ifpgfplots@autocompute@xlim
+ \pgfplots@draw@at@endtrue
+ \pgfplots@autocomputelimitstrue
+ \global\pgfplots@limits@are@computedfalse
+ \fi
+ \ifpgfplots@autocompute@ylim
+ \pgfplots@draw@at@endtrue
+ \pgfplots@autocomputelimitstrue
+ \global\pgfplots@limits@are@computedfalse
+ \fi
+ %
+ %
+ % --------------------
+ % Start axis:
+ % either postponed to \end or directly.
+ % --------------------
+ %
+ % Since I've introduced a public \numplots macro, I should
+ % make sure it's filled correctly:
+ \pgfplots@draw@at@endtrue
+ %
+ \ifpgfplots@collect@firstplot@astick
+ \pgfplots@draw@at@endtrue
+ \fi
+ \ifpgfplots@apply@datatrafo
+ % ALWAYS TRUE. This allows to use inline plots because the data
+ % scale transformation will be applied after I know that it should
+ % be disabled.
+ \pgfplots@draw@at@endtrue
+ \fi
+ \ifpgfplots@stackedmode
+ % Stacked plots require special attention: they are drawn in
+ % REVERSE order.
+ \pgfplots@draw@at@endtrue
+ \else
+ % we have no stacked plots and thus no reversing.
+ \pgfplots@stacked@reversefalse
+ \fi
+ %
+ % any \path command is invalid inside of an axis.
+ % Use \axispath instead:
+ \def\numplots{\the\pgfplots@numplots}%
+ \let\path=\pgfplots@replacement@for@tikz@path
+ \let\closedcycle=\pgfplots@path@closed@cycle
+ \ifpgfplots@draw@at@end
+ \let\pgfplots@nextcommand=\relax
+ \else
+ \def\pgfplots@nextcommand{\pgfplots@BEGIN@init@and@draw@axis}%
+ \fi
+ \pgfplots@nextcommand
+}
+\def\endpgfplots@environment@opt{%
+ \pgfkeysvalueof{/pgfplots/before end axis/.@cmd}\pgfeov%
+ \xdef\numplots{\the\pgfplots@numplots}%
+ %
+ % restore old \path command:
+ \let\path=\pgfplots@orig@path
+ \let\plot=\pgfplots@orig@plot
+ %
+ %\end{axis}:
+ % --------------------
+ % All plotting commands have been read.
+ % -> apply postponed drawing commands!
+ % --------------------
+ \ifpgfplots@draw@at@end
+ \def\pgfplots@nextcommand{%
+ \pgfplots@BEGIN@init@and@draw@axis
+ \pgfplots@stacked@initialise
+ \ifpgfplots@stacked@reverse
+ % This here applies any scaling trafos and assembles a
+ % NEW \pgfplots@stored@plotlist!
+ \pgfplots@stacked@finalize@stored@plots
+ \fi
+ \pgfplotslistforeach\pgfplots@stored@plotlist\as\pgfplots@TMP{%
+ \expandafter\pgfplots@stored@plotlist@EXTRACTENTRY\pgfplots@TMP
+%\message{Processing stored plot with precommand '\meaning\pgfplots@stored@current@precmd'; pgfplots@plotcmd '\meaning\pgfplots@stored@current@cmd' postcommand '\meaning\pgfplots@stored@current@postcmd'}%
+ \pgfplots@stored@current@precmd
+ \ifx\pgfplots@stored@current@cmd\pgfutil@empty
+ \pgfplots@stored@current@data%
+ \else
+ % this code here means we REALLY have a plotting
+ % command!
+ \ifpgfplots@stacked@reverse
+ % has already been processed above, in \pgfplots@stacked@finalize@stored@plots.
+ \else
+ \ifpgfplots@apply@datatrafo
+ % Apply the data scaling transformation
+ \expandafter\pgfplots@coord@stream@finalize@storedcoords@START\pgfplots@stored@current@data\to\pgfplots@stored@current@data%
+ \fi
+ \fi
+%\message{calling plotcmd and plotdata: pgfplots@plotcmd '\meaning\pgfplots@stored@current@cmd' data '\meaning\pgfplots@stored@current@data'}%
+ \expandafter\pgfplots@stored@current@cmd\pgfplots@stored@current@data
+ \fi
+ \pgfplots@stored@current@postcmd
+ }%
+ \global\pgfplotslistnewempty\pgfplots@stored@plotlist% delete contents.
+ }%
+ \else
+ \let\pgfplots@nextcommand=\relax
+ \fi
+ \pgfplots@nextcommand
+ \pgfplots@END@init@and@draw@axis
+ %
+ \begingroup
+ \pgfkeysvalueof{/pgfplots/after end axis/.@cmd}\pgfeov%
+ \endgroup
+ %
+ \begingroup
+ % set coordinate system to (0,0) rectangle (1,1) for descriptions:
+ \pgftransformxshift{\pgfplots@xcoordminTEX}%
+ \pgftransformyshift{\pgfplots@ycoordminTEX}%
+ %
+ \pgfplots@tmpa=\pgfplots@xcoordmaxTEX
+ \advance\pgfplots@tmpa by-\pgfplots@xcoordminTEX
+ \pgfsetxvec{\pgfqpoint{\pgfplots@tmpa}{0cm}}%
+ %
+ \pgfplots@tmpa=\pgfplots@ycoordmaxTEX
+ \advance\pgfplots@tmpa by-\pgfplots@ycoordminTEX
+ \pgfsetyvec{\pgfqpoint{0cm}{\pgfplots@tmpa}}%
+ %
+ \pgfplots@create@axis@descriptions
+ \pgfkeysvalueof{/pgfplots/extra description/.@cmd}\pgfeov%
+ \endgroup
+ \endtikzpicture%
+ \begingroup
+ % Protocol sizes for the axis-shape.
+ % I fear that needs to be done globally, do avoid all those
+ % \endgroup's in and after \endpgfinterruptpicture ...
+ \ifdim\pgf@picmaxx=-16000pt\relax%
+ \pgf@picmaxx=0pt\relax%
+ \pgf@picminx=0pt\relax%
+ \pgf@picmaxy=0pt\relax%
+ \pgf@picminy=0pt\relax%
+ \fi%
+ %
+ \xdef\pgfplots@saveddimen@picminx{\the\pgf@picminx}%
+ \xdef\pgfplots@saveddimen@picminy{\the\pgf@picminy}%
+ %
+ \pgf@xa=\pgfplots@xcoordmaxTEX
+ \advance\pgf@xa by-\pgf@picminx
+ \xdef\pgfplots@savedanchor@inner@upperright@x{\the\pgf@xa}%
+ %
+ \pgf@xa=\pgfplots@xcoordminTEX
+ \advance\pgf@xa by-\pgf@picminx
+ \xdef\pgfplots@savedanchor@inner@lowerleft@x{\the\pgf@xa}%
+ %
+ \pgf@xa=\pgfplots@ycoordmaxTEX
+ \advance\pgf@xa by-\pgf@picminy
+ \xdef\pgfplots@savedanchor@inner@upperright@y{\the\pgf@xa}%
+ %
+ \pgf@xa=\pgfplots@ycoordminTEX
+ \advance\pgf@xa by-\pgf@picminy
+ \xdef\pgfplots@savedanchor@inner@lowerleft@y{\the\pgf@xa}%
+ \endgroup
+ \endpgfinterruptpicture
+ \egroup\egroup% end of pgfnodepartimagebox
+ %
+ \let\tikz@fig@name=\pgfplots@fig@name
+ \tikz@fig@mustbenamed
+ \pgftransformshift{\pgfplots@at}%
+ \pgfmultipartnode{pgfplots@low@level@shape}{\pgfplots@anchorname}{\tikz@fig@name}{\pgfusepath{discard}}%
+ \pgfplots@fig@alias
+ %
+ \pgfplots@finally@correct@child@node@positions
+ \pgfplots@stacked@finalize
+ \endgroup
+}
+
+% Now, we need to process all named nodes inside of our
+% axis-image.
+%
+% The situation at this point is as follows:
+% 1. the complete axis image has been "typeset" into a box. That
+% means its coordinate system is LOST up to those variables
+% which have been saved explicitly.
+%
+% 2. the \pgfmultipartnode above knows about all axis anchors and
+% saved dimensions.
+%
+% 3. All sub-nodes don't know about their position any more. Any
+% saved anchors are wrong.
+%
+% The approach:
+% 1. we shift each named node's saved anchors such that it's
+% coordinate is valid inside of the TeX box.
+%
+% 2. we also shift each named node's saved anchors to reflect the
+% axis' anchor.
+%
+% Afterwards, everything should be fine.
+\def\pgfplots@finally@correct@child@node@positions{%
+ \ifx\pgfplots@named@child@node@list\pgfutil@empty%
+ \else%
+ \begingroup
+ \pgftransformreset% FIXME: what's that for!? Copied from matrix code...
+ %
+ % Use the 'image' anchor here - the internal anchor
+ % transformation matrix already has the shift for
+ % \pgfplots@anchorname.
+ \pgfpointanchor{\tikz@fig@name}{image}%
+ \pgf@xa=\pgf@x
+ \pgf@xb=\pgf@y
+ \pgf@process{\pgfqpoint{\pgfplots@saveddimen@picminx}{\pgfplots@saveddimen@picminy}}%
+ \advance\pgf@xa by-\pgf@x
+ \advance\pgf@xb by-\pgf@y
+ \pgf@x=\pgf@xa
+ \pgf@y=\pgf@xb
+ \edef\pgfplots@offset{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ %
+ \pgfutil@for\pgfplots@child@node@name:=\pgfplots@named@child@node@list\do{%
+ \ifx\pgfplots@child@node@name\pgfutil@empty
+ \else
+ \expandafter\ifx\csname pgfplots@child@node@visited@\pgfplots@child@node@name\endcsname\relax%
+ \pgfutil@ifundefined{pgf@sh@nt@\pgfplots@child@node@name}{%
+ \pgfplots@warning{Package pgfplots WARNING: could not adjust coordinates of named node '\pgfplots@child@node@name' for reasons I do not understand! After finishing the image, it did no longer exist!? Sorry.}%
+ }{%
+ \pgf@shift@node{\pgfplots@child@node@name}{\pgfplots@offset}%
+ \expandafter\let\csname pgfplots@child@node@visited@\pgfplots@child@node@name\endcsname=\pgfutil@empty%
+ }%
+ \fi
+ \fi
+ }%
+ \endgroup
+ \fi%
+}%
+
+\def\pgfplots@environment@axis{%
+ \pgfutil@ifnextchar[{\pgfplots@@environment@axis}{\pgfplots@@environment@axis[]}%
+}
+\let\endpgfplots@environment@axis=\endpgfplots@environment@opt
+\def\pgfplots@@environment@axis[#1]{%
+ \pgfplots@environment@opt[/pgfplots/xmode=linear,/pgfplots/ymode=linear,#1]%
+}
+
+\def\pgfplots@environment@semilogxaxis{%
+ \pgfutil@ifnextchar[{\pgfplots@@environment@semilogxaxis}{\pgfplots@@environment@semilogxaxis[]}%
+}
+\let\endpgfplots@environment@semilogxaxis=\endpgfplots@environment@opt
+\def\pgfplots@@environment@semilogxaxis[#1]{%
+ \pgfplots@environment@opt[/pgfplots/xmode=log,/pgfplots/ymode=linear,#1]%
+}
+
+\def\pgfplots@environment@semilogyaxis{%
+ \pgfutil@ifnextchar[{\pgfplots@@environment@semilogyaxis}{\pgfplots@@environment@semilogyaxis[]}%
+}
+\let\endpgfplots@environment@semilogyaxis=\endpgfplots@environment@opt
+\def\pgfplots@@environment@semilogyaxis[#1]{%
+ \pgfplots@environment@opt[/pgfplots/xmode=linear,/pgfplots/ymode=log,#1]%
+}
+
+\def\pgfplots@environment@loglogaxis{%
+ \pgfutil@ifnextchar[{\pgfplots@@environment@loglogaxis}{\pgfplots@@environment@loglogaxis[]}%
+}
+\let\endpgfplots@environment@loglogaxis=\endpgfplots@environment@opt
+\def\pgfplots@@environment@loglogaxis[#1]{%
+ \pgfplots@environment@opt[/pgfplots/xmode=log,/pgfplots/ymode=log,#1]%
+}
+
+
+\pgfutil@ifundefined{tikzaddtikzonlycommandshortcutlet}{%
+ \def\tikzaddtikzonlycommandshortcutlet#1#2{%
+ \expandafter\def\expandafter\tikz@installcommands\expandafter{\tikz@installcommands
+ \let#1=#2
+ }%
+ }%
+}{}
+
+\tikzaddtikzonlycommandshortcutlet\axis\pgfplots@environment@axis
+\tikzaddtikzonlycommandshortcutlet\endaxis\endpgfplots@environment@axis
+
+\tikzaddtikzonlycommandshortcutlet\semilogxaxis\pgfplots@environment@semilogxaxis
+\tikzaddtikzonlycommandshortcutlet\endsemilogxaxis\endpgfplots@environment@semilogxaxis
+
+\tikzaddtikzonlycommandshortcutlet\semilogyaxis\pgfplots@environment@semilogyaxis
+\tikzaddtikzonlycommandshortcutlet\endsemilogyaxis\endpgfplots@environment@semilogyaxis
+
+\tikzaddtikzonlycommandshortcutlet\loglogaxis\pgfplots@environment@loglogaxis
+\tikzaddtikzonlycommandshortcutlet\endloglogaxis\endpgfplots@environment@loglogaxis
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots/pgfplots.stackedplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/pgfplots.stackedplots.code.tex
new file mode 100644
index 00000000000..1612ca8c7f5
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots/pgfplots.stackedplots.code.tex
@@ -0,0 +1,365 @@
+%--------------------------------------------
+%
+% Package pgfplots
+%
+% Provides a user-friendly interface to create function plots (normal
+% plots, semi-logplots and double-logplots).
+%
+% It is based on Till Tantau's PGF package.
+%
+% Copyright 2007/2008 by Christian Feuersänger.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%--------------------------------------------
+
+%
+% This file contains the implementation for stacked plots.
+%
+% Stacked plots always keep record of the last plotted coordinates.
+% Any new plot will be ADDED on top of the last plotted coordinates.
+%
+% Terminology: "last plotted coordinates" are called "zero levels"
+% because they actually work like shifts.
+%
+% Programming Structure:
+%
+% 1. We keep TWO lists of coordinates: a list of CURRENT zero level
+% coordinates and a list of NEXT zero level coordinates.
+%
+% The first one will be queried whenever a zero level coordinate is
+% requested.
+%
+% The second one will be used to form zero levels for the next plot.
+%
+% 2. At the beginning and end of each plot, the lists in 1.) are
+% initialised properly.
+%
+% 3. While plot coordinates are processed, the following methods
+% interact with the stacked API:
+% \pgfplots@stacked@preparepoint@inmacro
+% -> compute the 'stacked' sum.
+% This may need to be done with floating point arithmetics because
+% the data scaling trafo is not yet initialised
+%
+% \pgfplots@stacked@finishpoint
+% -> takes coordinates as they will be given to Tikz. This method is
+% used to
+% - communicate zero level coordinates to Tikz
+% - implement the 'closed paths' option (allows filled stacked plots).
+%
+% \pgfplots@stacked@rememberzerolevelpoint@for@next@plot
+% \pgfplots@stacked@getnextzerolevelpoint
+%
+% 4. Zero levels are communicated to Tikz by
+% \pgfplots@stacked@initzerolevelhandler. This routine initialises an
+% input stream for Tikz plot handlers which produces a sequence of
+% zero levels. It is used by [xy]comb and [xy]bar.
+%
+%
+% REMARK:
+% the state of the boolean \ifpgfplots@datascaletrafo@initialised
+% determines whether these routines expect and return floating point
+% numbers or fixed point numbers.
+
+\let\pgfplots@stacked@zerolevelpoint@x=\pgfutil@empty
+\let\pgfplots@stacked@zerolevelpoint@y=\pgfutil@empty
+\newif\ifpgfplots@stacked@isfirstplot
+\newif\ifpgfplots@stacked@isinitialised
+
+% Pre-initialisation.
+% Needs to be called before the first call to
+% \pgfplots@stacked@beginplot.
+\def\pgfplots@stacked@initialise{%
+ \pgfplots@stacked@isfirstplottrue
+ \pgfplots@stacked@isinitialisedtrue
+}%
+
+% Cleanup method. Truncates any global variables to reduce string
+% space.
+\def\pgfplots@stacked@finalize{%
+ \global\pgfplotslistnewempty\pgfplots@stacked@zerolevellist
+ \global\pgfplotslistnewempty\pgfplots@stacked@nextzerolevellist
+ \pgfplots@stacked@isinitialisedfalse
+}%
+
+% (Re)defines the macro \pgfplots@stacked@getnextzerolevelpoint
+% at the beginning of each plot.
+%
+% The macro \pgfplots@stacked@getnextzerolevelpoint fills
+% \pgfplots@stacked@zerolevelpoint@[xy].
+%
+% ATTENTION: call \pgfplots@stacked@initialise before the first call
+% to beginplot!
+\def\pgfplots@stacked@beginplot{%
+%\message{pgfplots@stacked@beginplot: PLOT STARTED.}%
+ \ifpgfplots@stacked@isinitialised
+ \else
+ \pgfplots@error{LOGIC ERROR: please call \string\pgfplots@stacked@initialise.}%
+ \fi
+ \global\pgfplotslistnewempty\pgfplots@stacked@PGFzerolevels
+ % accumulate this command here for \closedcycle:
+ \let\pgfplots@stacked@closedcycle@impl=\pgfutil@empty
+ \ifpgfplots@stacked@isfirstplot
+ \global\pgfplotslistnewempty\pgfplots@stacked@zerolevellist
+ \def\pgfplots@stacked@zerolevelpoint@x{0}%
+ \def\pgfplots@stacked@zerolevelpoint@y{0}%
+ \ifpgfplots@datascaletrafo@initialised
+ % work with pgfmath if possible - its faster.
+ \else
+ % only work with float if its really necessary - for
+ % example if the scaling trafo which maps to pgfmath is
+ % not yet initialised.
+ \ifpgfplots@float@numerics@mode@x
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \let\pgfplots@stacked@zerolevelpoint@x=\pgfmathresult
+ \fi
+ \ifpgfplots@float@numerics@mode@y
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \let\pgfplots@stacked@zerolevelpoint@y=\pgfmathresult
+ \fi
+ \fi
+ \def\pgfplots@stacked@getnextzerolevelpoint{}% will remain constant anyway.
+ \else
+ {\globaldefs=1
+ \pgfplotslistcopy\pgfplots@stacked@nextzerolevellist\to\pgfplots@stacked@zerolevellist
+ }%
+ \def\pgfplots@stacked@getnextzerolevelpoint{%
+ {\globaldefs=1
+ \pgfplotslistpopfront\pgfplots@stacked@zerolevellist\to\pgfmathresult
+ }%
+ \expandafter\pgfplots@stacked@parsezerolevelpoint\pgfmathresult
+ }%
+ \fi
+ \global\pgfplotslistnewempty\pgfplots@stacked@nextzerolevellist
+}%
+
+\def\pgfplots@stacked@parsezerolevelpoint(#1,#2){%
+ \def\pgfplots@stacked@zerolevelpoint@x{#1}%
+ \def\pgfplots@stacked@zerolevelpoint@y{#2}%
+}
+
+\def\pgfplots@stacked@endplot{%
+ \ifpgfplots@stacked@isfirstplot
+ \let\pgfplots@stacked@closedcycle@impl=\pgfplots@path@closed@cycle@std
+ \else
+ \pgfplots@toka=\expandafter{\pgfplots@stacked@closedcycle@impl}%
+ \edef\pgfplots@stacked@closedcycle@impl{%
+ [mark=none,/utils/exec=\noexpand\pgfplots@try@mirror@plot@handler]
+ --plot coordinates{\the\pgfplots@toka}
+ --cycle
+ }%
+ \fi
+ \global\pgfplots@stacked@isfirstplotfalse
+%\message{pgfplots@stacked@endplot: PLOT ENDED}%
+}%
+
+% WARNING: when this method is called, NEITHER
+% \ifpgfplots@stacked@isfirstplot NOR the zero level lists are
+% initialised!
+\def\pgfplots@stacked@initzerolevelhandler{%
+ \ifpgfplots@stacked@x
+ \pgfplotxzerolevelstream@@list
+ \pgfplotyzerolevelstreamconstant{\pgfplots@ZERO@y}%
+ \else
+ \pgfplotxzerolevelstreamconstant{\pgfplots@ZERO@x}%
+ \pgfplotyzerolevelstream@@list
+ \fi
+}%
+
+\def\pgfplots@stacked@rememberzerolevelpoint@for@next@plot#1{%
+ \edef\pgfplots@TMP{#1}%
+ {\globaldefs=1
+ \expandafter\pgfplotslistpushback\pgfplots@TMP\to\pgfplots@stacked@nextzerolevellist
+ }%
+}
+
+\def\pgfplots@stacked@finishpoint#1#2{%
+ \ifpgfplots@stacked@isfirstplot
+ \else
+ \pgfpointxy{\pgfplots@stacked@zerolevelpoint@x}{\pgfplots@stacked@zerolevelpoint@y}%
+ \ifpgfplots@stacked@x
+ \edef\pgfplots@TMP{\the\pgf@x}%
+ \else
+ \edef\pgfplots@TMP{\the\pgf@y}%
+ \fi
+ {\globaldefs=1
+ \expandafter\pgfplotslistpushback\pgfplots@TMP\to\pgfplots@stacked@PGFzerolevels
+ }%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@stacked@closedcycle@impl}%
+ \edef\pgfplots@stacked@closedcycle@impl{%
+ (\pgfplots@stacked@zerolevelpoint@x,\pgfplots@stacked@zerolevelpoint@y)%
+ \the\pgfplotslist@TOK@a}%
+ \fi
+}%
+
+\def\pgfplots@stacked@preparepoint@inmacro#1#2{%
+ \pgfplots@stacked@getnextzerolevelpoint
+ \ifpgfplots@stacked@x
+ \ifpgfplots@stacked@plus
+ \let\pgfplots@stacked@op=\pgfmathadd@
+ \else
+ \let\pgfplots@stacked@op=\pgfmathsubtract@
+ \fi
+ \ifpgfplots@float@numerics@mode@x
+ \ifpgfplots@datascaletrafo@initialised
+ \else
+ \ifpgfplots@stacked@plus
+ \let\pgfplots@stacked@op=\pgfmathfloatadd@
+ \else
+ \let\pgfplots@stacked@op=\pgfmathfloatsubtract@
+ \fi
+ \fi
+ \fi
+ \pgfplots@stacked@op{\pgfplots@stacked@zerolevelpoint@x}{#1}%
+ \let#1=\pgfmathresult
+ \else
+ \ifpgfplots@stacked@plus
+ \let\pgfplots@stacked@op=\pgfmathadd@
+ \else
+ \let\pgfplots@stacked@op=\pgfmathsubtract@
+ \fi
+ \ifpgfplots@float@numerics@mode@y
+ \ifpgfplots@datascaletrafo@initialised
+ \else
+ \ifpgfplots@stacked@plus
+ \let\pgfplots@stacked@op=\pgfmathfloatadd@
+ \else
+ \let\pgfplots@stacked@op=\pgfmathfloatsubtract@
+ \fi
+ \fi
+ \fi
+ \pgfplots@stacked@op{\pgfplots@stacked@zerolevelpoint@y}{#2}%
+ \let#2=\pgfmathresult
+ \fi
+ \pgfplots@stacked@rememberzerolevelpoint@for@next@plot{(#1,#2)}%
+}
+
+% This here is a re-implementation of the stored plot processing.
+%
+% The idea is simply, although it requires quite some work:
+%
+% If we stack plots on top of each other, early drawing commands
+% (early plots) will be OVERDRAWN by later drawing commands (later
+% plots). This is especially unfortunate if we use filled bar plots
+% or comb plots.
+%
+% IDEA: draw plots in REVERSE order. The positioning, styles and
+% whatever must not be affected, only the sequence of drawing commands
+% shall change.
+%
+% So, this command here does all numerics which is to be done and
+% assembles a NEW, REVERSED STORED PLOT LIST.
+\def\pgfplots@stacked@finalize@stored@plots{%
+ \pgfplotslistnewempty\pgfplots@stored@plotlist@reversed
+ \begingroup
+ \pgfplotslistforeachungrouped\pgfplots@stored@plotlist\as\pgfplots@TMP{%
+ \expandafter\pgfplots@stored@plotlist@EXTRACTENTRY\pgfplots@TMP
+ \ifx\pgfplots@stored@current@cmd\pgfutil@empty
+ \else
+ \ifpgfplots@apply@datatrafo
+ % Apply the data scaling transformation, but do NOT
+ % issue any drawing commands (-> use the ...@dryrun
+ % version)
+ \expandafter\pgfplots@coord@stream@finalize@storedcoords@START@dryrun\pgfplots@stored@current@data\to\pgfplots@stored@current@data\pgfplots@stored@current@precmdapp%
+ % save any intermediate results as "precmd":
+ \pgfplotslist@TOK@b=\expandafter{\pgfplots@stored@current@precmd}%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@stored@current@precmdapp}%
+ \edef\pgfplots@stored@current@precmd{\the\pgfplotslist@TOK@b\the\pgfplotslist@TOK@a}%
+ \fi
+ \fi
+ % Now, we need to insert all stored entities into the new,
+ % reversed list. We only expand them ONCE.
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@stored@current@precmd}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplots@stored@current@cmd}%
+ \edef\pgfplots@TMP{%
+ {\the\pgfplotslist@TOK@a}{\the\pgfplotslist@TOK@b}}%
+ \pgfplots@toka=\expandafter{\pgfplots@TMP}%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@stored@current@data}%
+ \pgfplotslist@TOK@b=\expandafter{\pgfplots@stored@current@postcmd}%
+ \edef\pgfplots@TMP{%
+ \the\pgfplots@toka
+ {\the\pgfplotslist@TOK@a}{\the\pgfplotslist@TOK@b}}%
+ % Reverse sequence:
+ \expandafter\pgfplotslistpushfront\pgfplots@TMP\to\pgfplots@stored@plotlist@reversed
+ }%
+ % Now, overwrite the original list:
+ \global\let\pgfplots@stored@plotlist=\pgfplots@stored@plotlist@reversed
+ \endgroup
+}%
+
+\def\pgfplots@stacked@path@closed@cycle{%
+ \pgfplots@stacked@closedcycle@impl
+}
+
+% Saves the finalized variables into macro #1 such that a call to #1
+% restores them.
+%
+% This affects pgf zero level handlers and whether this here is the
+% first plot or not..
+\def\pgfplots@stacked@savestateto#1{%
+ \pgfplotslist@TOK@a=\expandafter{\pgfplots@stacked@PGFzerolevels}%
+ \ifpgfplots@stacked@isfirstplot
+ \pgfplotslist@TOK@b={\pgfplots@stacked@isfirstplottrue}%
+ \else
+ \pgfplotslist@TOK@b={\pgfplots@stacked@isfirstplotfalse}%
+ \fi
+ \pgfplots@toka=\expandafter{\pgfplots@stacked@closedcycle@impl}%
+ \edef#1{%
+ \noexpand\gdef\noexpand\pgfplots@stacked@PGFzerolevels{\the\pgfplotslist@TOK@a}%
+ \the\pgfplotslist@TOK@b
+ \noexpand\def\noexpand\pgfplots@stacked@closedcycle@impl{\the\pgfplots@toka}%
+ }%
+}
+
+% PGF interfaces:
+\def\pgfplotxzerolevelstream@@list{%
+ \def\pgf@plotxzerolevelstreamstart{%
+ \global\let\pgfplotxzerolevelstream@@list@@backup=\pgfplots@stacked@PGFzerolevels
+ \gdef\pgf@plotxzerolevelstreamnext{%
+ \pgfplotslistcheckempty\pgfplots@stacked@PGFzerolevels
+ \ifpgfplotslistempty
+ \global\pgf@x=\pgfplots@ZERO@x\relax
+ \else
+ {\globaldefs=1\relax
+ \pgfplotslistpopfront\pgfplots@stacked@PGFzerolevels\to\pgfmathresult
+ }%
+ \global\pgf@x=\pgfmathresult\relax
+ \fi
+ }%
+ }%
+ \def\pgf@plotxzerolevelstreamend{%
+ \global\let\pgfplots@stacked@PGFzerolevels=\pgfplotxzerolevelstream@@list@@backup
+ }%
+}%
+
+\def\pgfplotyzerolevelstream@@list{%
+ \def\pgf@plotyzerolevelstreamstart{%
+ \global\let\pgfplotyzerolevelstream@@list@@backup=\pgfplots@stacked@PGFzerolevels
+ \gdef\pgf@plotyzerolevelstreamnext{%
+ \pgfplotslistcheckempty\pgfplots@stacked@PGFzerolevels
+ \ifpgfplotslistempty
+ \global\pgf@x=\pgfplots@ZERO@y\relax
+ \else
+ {\globaldefs=1\relax
+ \pgfplotslistpopfront\pgfplots@stacked@PGFzerolevels\to\pgfmathresult
+ }%
+ \global\pgf@x=\pgfmathresult\relax
+ \fi
+ }%
+ }%
+ \def\pgf@plotyzerolevelstreamend{%
+ \global\let\pgfplots@stacked@PGFzerolevels=\pgfplotyzerolevelstream@@list@@backup
+ }%
+}%