diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex | 7192 |
1 files changed, 7192 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex new file mode 100644 index 00000000000..53b602b0d9a --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex @@ -0,0 +1,7192 @@ +%-------------------------------------------- +% +% 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 pgfplotsutil.code.tex +\input pgfplotsoldpgfsupp_loader.code.tex +\input pgfplots.stackedplots.code.tex + +\usetikzlibrary{decorations,decorations.pathmorphing,decorations.pathreplacing} + +% FIXME: reduce number of variables! + +\newif\ifpgfplots@xislinear +\newif\ifpgfplots@yislinear +\newcount\pgfplots@numplots +\newdimen\pgfplots@xcoordminTEX +\newdimen\pgfplots@xcoordmaxTEX +\newdimen\pgfplots@ycoordminTEX +\newdimen\pgfplots@ycoordmaxTEX +\newif\ifpgfplots@warn@for@filter@discards +\newif\ifpgfplots@isuniformtick +\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@clip@marker@paths +\newif\ifpgfplots@axis@on@top +\newif\ifpgfplots@separate@axis@lines +\newif\ifpgfplots@scaled@ticks@x +\newif\ifpgfplots@scaled@ticks@y +\newif\ifpgfplots@identify@log@minor@tick@pos +\newif\ifpgfplots@disablelogfilter +\newif\ifpgfplots@disabledatascaling +\newif\ifpgfplots@hide@x +\newif\ifpgfplots@hide@y +\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 +\newif\ifpgfplots@plot@file@skipfirst +\let\pgfnodepartimagebox=\pgfnodeparttextbox + +\newif\ifpgfplots@collect@firstplot@astick + +\def\pgfplots@errorbars@xdirection{0}% pre-init, see below +\def\pgfplots@errorbars@ydirection{0}% + +\def\axisdefaultwidth{240pt} +\def\axisdefaultheight{207pt} + + + + +% 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}{% + every mark/.append style={fill=gray},mark=*\\% + every mark/.append style={fill=gray},mark=square*\\% + every mark/.append style={fill=gray},mark=otimes*\\% + mark=star\\% + every mark/.append style={fill=gray},mark=diamond*\\% + densely dashed,every mark/.append style={solid,fill=gray},mark=*\\% + densely dashed,every mark/.append style={solid,fill=gray},mark=square*\\% + densely dashed,every mark/.append style={solid,fill=gray},mark=otimes*\\% + densely dashed,every mark/.append style={solid},mark=star\\% + densely dashed,every mark/.append style={solid,fill=gray},mark=diamond*\\% +} +\pgfcreateplotcyclelist{\coloredplotspeclist}{% + blue,every mark/.append style={fill=blue!80!black},mark=*\\% + red,every mark/.append style={fill=red!80!black},mark=square*\\% + brown!60!black,every mark/.append style={fill=brown!80!black},mark=otimes*\\% + black,mark=star\\% + blue,every mark/.append style={fill=blue!80!black},mark=diamond*\\% + red,densely dashed,every mark/.append style={solid,fill=red!80!black},mark=*\\% + brown!60!black,densely dashed,every mark/.append style={solid,fill=brown!80!black},mark=square*\\% + black,densely dashed,every mark/.append style={solid,fill=gray},mark=otimes*\\% + blue,densely dashed,mark=star,every mark/.append style=solid\\% + red,densely dashed,every mark/.append style={solid,fill=red!80!black},mark=diamond*\\% +} + +\def\pgfplotsset#{\pgfqkeys{/pgfplots}} + +\def\pgfplotsdeprecatedstylecheck#1{% + \pgfkeysifdefined{#1/.@cmd}{% + \begingroup + \edef\pgfkeyscurrentkey{#1}% + \pgfkeyssplitpath + \pgfplots@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 inner x axis line/.style={}, + /pgfplots/every inner y axis line/.style={}, + /pgfplots/every outer x axis line/.style={}, + /pgfplots/every outer y axis line/.style={}, + /pgfplots/x axis line style/.style={ + /pgfplots/every outer x axis line/.append style={#1}, + /pgfplots/every inner x axis line/.append style={#1}, + }, + /pgfplots/y axis line style/.style={ + /pgfplots/every outer y axis line/.append style={#1}, + /pgfplots/every inner y axis line/.append style={#1}, + }, + /pgfplots/outer axis line style/.style={ + /pgfplots/every outer x axis line/.append style={#1}, + /pgfplots/every outer y axis line/.append style={#1}% + }, + /pgfplots/inner axis line style/.style={ + /pgfplots/every inner x axis line/.append style={#1}, + /pgfplots/every inner y axis line/.append style={#1}% + }, + /pgfplots/axis line style/.style={ + /pgfplots/inner axis line style={#1}, + /pgfplots/outer axis line style={#1}% + }, + /pgfplots/separate axis lines/.is if=pgfplots@separate@axis@lines, + /pgfplots/separate axis lines/.default=true, + /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/.style={thin,black!25}, + /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/log identify minor tick positions=true, + }, + /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/log identify minor tick positions=true, + }, + /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 x ticks/.is if=pgfplots@scaled@ticks@x, + /pgfplots/scaled x ticks/.belongs to family=/pgfplots/tick, + /pgfplots/scaled x ticks=true, + /pgfplots/scaled y ticks/.is if=pgfplots@scaled@ticks@y, + /pgfplots/scaled y ticks/.belongs to family=/pgfplots/tick, + /pgfplots/scaled y ticks=true, + /pgfplots/scaled ticks/.style={% + /pgfplots/scaled x ticks=#1, + /pgfplots/scaled y ticks=#1}, + /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=false, + /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@[xy]tickposnum to + /pgfplots/xtick pos/.is choice, + /pgfplots/xtick pos/.belongs to family=/pgfplots/tick, + /pgfplots/xtick pos/left/.code ={\def\pgfplots@xtickposnum{1}}, + /pgfplots/xtick pos/left/.belongs to family=/pgfplots/tick, + /pgfplots/xtick pos/right/.code ={\def\pgfplots@xtickposnum{3}}, + /pgfplots/xtick pos/right/.belongs to family=/pgfplots/tick, + /pgfplots/xtick pos/both/.code ={\def\pgfplots@xtickposnum{0}}, + /pgfplots/xtick pos/both/.belongs to family=/pgfplots/tick, + /pgfplots/xtick pos=both, + /pgfplots/ytick pos/.is choice, + /pgfplots/ytick pos/.belongs to family=/pgfplots/tick, + /pgfplots/ytick pos/left/.code ={\def\pgfplots@ytickposnum{1}}, + /pgfplots/ytick pos/left/.belongs to family=/pgfplots/tick, + /pgfplots/ytick pos/right/.code ={\def\pgfplots@ytickposnum{3}}, + /pgfplots/ytick pos/right/.belongs to family=/pgfplots/tick, + /pgfplots/ytick pos/both/.code ={\def\pgfplots@ytickposnum{0}}, + /pgfplots/ytick pos/both/.belongs to family=/pgfplots/tick, + /pgfplots/ytick pos/top/.style={/pgfplots/ytick pos/right}, + /pgfplots/ytick pos/bottom/.style={/pgfplots/ytick pos/left}, + /pgfplots/ytick pos=both, + /pgfplots/tickpos/.style={/pgfplots/xtick pos={#1},/pgfplots/ytick pos={#1}}, + /pgfplots/tickpos/.belongs to family=/pgfplots/tick, +% sets the tick LABEL position, \pgfplots@[xy]ticklabelposnum + /pgfplots/xticklabel pos/.is choice, + /pgfplots/xticklabel pos/.belongs to family=/pgfplots/tick, + /pgfplots/xticklabel pos/default/.code ={\def\pgfplots@xticklabelposnum{0}}, + /pgfplots/xticklabel pos/default/.belongs to family=/pgfplots/tick, + /pgfplots/xticklabel pos/left/.code ={\def\pgfplots@xticklabelposnum{1}}, + /pgfplots/xticklabel pos/left/.belongs to family=/pgfplots/tick, + /pgfplots/xticklabel pos/right/.code ={\def\pgfplots@xticklabelposnum{3}}, + /pgfplots/xticklabel pos/right/.belongs to family=/pgfplots/tick, + /pgfplots/xticklabel pos=default, + /pgfplots/yticklabel pos/.is choice, + /pgfplots/yticklabel pos/.belongs to family=/pgfplots/tick, + /pgfplots/yticklabel pos/default/.code ={\def\pgfplots@yticklabelposnum{0}}, + /pgfplots/yticklabel pos/default/.belongs to family=/pgfplots/tick, + /pgfplots/yticklabel pos/left/.code ={\def\pgfplots@yticklabelposnum{1}}, + /pgfplots/yticklabel pos/left/.belongs to family=/pgfplots/tick, + /pgfplots/yticklabel pos/right/.code ={\def\pgfplots@yticklabelposnum{3}}, + /pgfplots/yticklabel pos/right/.belongs to family=/pgfplots/tick, + /pgfplots/yticklabel pos/top/.style={/pgfplots/yticklabel pos/right}, + /pgfplots/yticklabel pos/bottom/.style={/pgfplots/yticklabel pos/left}, + /pgfplots/yticklabel pos=default, + /pgfplots/ticklabelpos/.style={/pgfplots/xticklabel pos={#1},/pgfplots/yticklabel pos={#1}}, +% sets \pgfplots@{x,y}tickalignnum to +% inside=0 +% outside=1 +% center=2 + /pgfplots/xtick align/.is choice, + /pgfplots/xtick align/.belongs to family=/pgfplots/tick, + /pgfplots/xtick align/inside/.code ={\def\pgfplots@xtickalignnum{0}}, + /pgfplots/xtick align/inside/.belongs to family=/pgfplots/tick, + /pgfplots/xtick align/outside/.code ={\def\pgfplots@xtickalignnum{1}}, + /pgfplots/xtick align/outside/.belongs to family=/pgfplots/tick, + /pgfplots/xtick align/center/.code ={\def\pgfplots@xtickalignnum{2}}, + /pgfplots/xtick align/center/.belongs to family=/pgfplots/tick, + /pgfplots/xtick align=inside, + /pgfplots/ytick align/.is choice, + /pgfplots/ytick align/.belongs to family=/pgfplots/tick, + /pgfplots/ytick align/inside/.code ={\def\pgfplots@ytickalignnum{0}}, + /pgfplots/ytick align/inside/.belongs to family=/pgfplots/tick, + /pgfplots/ytick align/outside/.code ={\def\pgfplots@ytickalignnum{1}}, + /pgfplots/ytick align/outside/.belongs to family=/pgfplots/tick, + /pgfplots/ytick align/center/.code ={\def\pgfplots@ytickalignnum{2}}, + /pgfplots/ytick align/center/.belongs to family=/pgfplots/tick, + /pgfplots/ytick align=inside, + /pgfplots/tick align/.belongs to family=/pgfplots/tick, + /pgfplots/tick align/.style={% + /pgfplots/xtick align=#1, + /pgfplots/ytick align=#1, + },% +% '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 entries/.initial={}, + /pgfplots/legend entries/.belongs to family=/pgfplots/legend, + /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/.initial=, + /pgfplots/title/.belongs to family=/pgfplots/descriptions, + /pgfplots/xlabel/.initial=, + /pgfplots/xlabel/.belongs to family=/pgfplots/descriptions, + /pgfplots/ylabel/.initial=, + /pgfplots/ylabel/.belongs to family=/pgfplots/descriptions, + /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={% + \pgfplots@assert@tikzinternal@exists{tikz@scan@one@point}% + \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/enlarge x limits/.initial=auto, + /pgfplots/enlarge x limits/.default=true, + /pgfplots/enlarge y limits/.initial=auto, + /pgfplots/enlarge y limits/.default=true, + /pgfplots/enlargelimits/.style={% + /pgfplots/enlarge x limits=#1,% + /pgfplots/enlarge y limits=#1,% + },% + /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 x axis/.is if=pgfplots@hide@x, + /pgfplots/hide x axis/.default=true, + /pgfplots/hide x axis=false, + /pgfplots/hide y axis/.is if=pgfplots@hide@y, + /pgfplots/hide y axis/.default=true, + /pgfplots/hide y axis=false, + /pgfplots/hide axis/.style={% + /pgfplots/hide x axis=#1, + /pgfplots/hide y axis=#1, + }, + /pgfplots/hide axis/.default=true, + /pgfplots/every non boxed x axis/.style={% + xtick align=center, + enlarge x limits=false, + x axis line style={-stealth} + }, + /pgfplots/every non boxed y axis/.style={% + ytick align=center, + enlarge y limits=false, + y axis line style={-stealth} + }, + /pgfplots/every boxed x axis/.style={}, + /pgfplots/every boxed y axis/.style={}, +% /pgfplots/hide axis/.belongs to family=/pgfplots, +% sets \pgfplots@xaxislinesnum to +% box=0 +% bottom=1 +% middle=2 ( aliased with center ) +% top=3 + /pgfplots/axis x line*/.is choice, + /pgfplots/axis x line*/box/.code ={\def\pgfplots@xaxislinesnum{0}\def\pgfplots@xtickposnum{0}}, + /pgfplots/axis x line*/bottom/.code ={\def\pgfplots@xaxislinesnum{1}\def\pgfplots@xtickposnum{1}}, + /pgfplots/axis x line*/middle/.code ={\def\pgfplots@xaxislinesnum{2}\def\pgfplots@xtickposnum{2}}, + /pgfplots/axis x line*/center/.style ={/pgfplots/axis x line*/middle}, + /pgfplots/axis x line*/top/.code ={\def\pgfplots@xaxislinesnum{3}\def\pgfplots@xtickposnum{3}}, + /pgfplots/axis x line*/none/.code ={\def\pgfplots@xaxislinesnum{4}\def\pgfplots@xtickposnum{4}}, + /pgfplots/axis x line*=box, + % + /pgfplots/axis x line/.is choice, + /pgfplots/axis x line/box/.style ={ + /pgfplots/axis x line*/box, + /pgfplots/every boxed x axis + }, + /pgfplots/axis x line/bottom/.style ={ + /pgfplots/axis x line*/bottom, + /pgfplots/every non boxed x axis + }, + /pgfplots/axis x line/middle/.code ={% + \ifnum\pgfplots@yaxislinesnum=3 % if 'axis y line==right' then + \pgfkeysalso{/pgfplots/every axis x label/.style={at={(current axis.left of origin)},anchor=south west}}% + \else + \pgfkeysalso{/pgfplots/every axis x label/.style={at={(current axis.right of origin)},anchor=south east}}% + \fi + \pgfkeysalso{/pgfplots/axis x line*/middle, + /pgfplots/every non boxed x axis}% + }, + /pgfplots/axis x line/center/.style ={/pgfplots/axis x line/middle}, + /pgfplots/axis x line/top/.code ={ + \ifnum\pgfplots@yaxislinesnum=2 % if 'axis y line==center' then + \pgfkeysalso{ + /pgfplots/every axis y label/.style={at={(current axis.below origin)},anchor=south west}}% + \fi + \pgfkeysalso{% + /pgfplots/axis x line*/top, + /pgfplots/every axis x label/.style={at={(0.5,1)},anchor=south,yshift=15pt}, + /pgfplots/every non boxed x axis}% + }, + /pgfplots/axis x line/none/.style ={axis x line*/none,hide x axis}, +% sets \pgfplots@yaxislinesnum to +% box=0 +% left=1 +% center=2 ( aliased with middle ) +% right=3 + /pgfplots/axis y line*/.is choice, + /pgfplots/axis y line*/box/.code ={\def\pgfplots@yaxislinesnum{0}\def\pgfplots@ytickposnum{0}}, + /pgfplots/axis y line*/left/.code ={\def\pgfplots@yaxislinesnum{1}\def\pgfplots@ytickposnum{1}}, + /pgfplots/axis y line*/center/.code ={\def\pgfplots@yaxislinesnum{2}\def\pgfplots@ytickposnum{2}}, + /pgfplots/axis y line*/middle/.style ={/pgfplots/axis y line*/center}, + /pgfplots/axis y line*/right/.code ={\def\pgfplots@yaxislinesnum{3}\def\pgfplots@ytickposnum{3}}, + /pgfplots/axis y line*/none/.code ={\def\pgfplots@yaxislinesnum{4}\def\pgfplots@ytickposnum{4}}, + /pgfplots/axis y line*=box, + % + /pgfplots/axis y line/.is choice, + /pgfplots/axis y line/box/.style ={ + /pgfplots/axis y line*/box, + /pgfplots/every boxed y axis + }, + /pgfplots/axis y line/left/.style ={ + /pgfplots/axis y line*/left, + /pgfplots/every non boxed y axis + }, + /pgfplots/axis y line/center/.code ={ + \ifnum\pgfplots@xaxislinesnum=3 % if 'axis x line==top' then + \pgfkeysalso{% + /pgfplots/every axis y label/.style={at={(current axis.below origin)},anchor=south west}}% + \else + \pgfkeysalso{% + /pgfplots/every axis y label/.style={at={(current axis.above origin)},anchor=north west}}% + \fi + \pgfkeysalso{% + /pgfplots/axis y line*/center, + /pgfplots/every non boxed y axis}% + }, + /pgfplots/axis y line/middle/.style ={/pgfplots/axis y line/center}, + /pgfplots/axis y line/right/.code ={% + \ifnum\pgfplots@xaxislinesnum=2 + \pgfkeysalso{every axis x label/.style={at={(current axis.left of origin)},anchor=south west}}% + \fi + \pgfkeysalso{ + axis y line*/right, + %every axis y label/.style={at={(1,1)},anchor=north west,xshift=15pt}, + every axis y label/.style={at={(1,0.5)},xshift=33pt,rotate=90}, + /pgfplots/every non boxed y axis + }% + },% + /pgfplots/axis y line/none/.style ={axis y line*/none,hide y axis}, +% 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/area legend/.style={% + /pgfplots/legend image code/.code={% + \draw[##1] (0cm,-0.1cm) rectangle (0.6cm,0.1cm); + }% + }, + /pgfplots/area style/.style={% + area cycle list, + area legend, + axis on top, + }, + /pgfplots/ybar/.style={ + bar cycle list, + xtick 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, + ytick 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 align=outside, + % 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, + ytick align=outside, + /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}$} + }, + /pgfplots/plot file/skip first/.is if=pgfplots@plot@file@skipfirst, + /pgfplots/plot file/skip first/.default=true, + /pgfplots/clip marker paths/.is if=pgfplots@clip@marker@paths, + /pgfplots/clip marker paths/.default=true, + /pgfplots/axis on top/.is if=pgfplots@axis@on@top, + /pgfplots/axis on top/.default=true, + /pgfplots/every crossref picture/.style={% + baseline,yshift=0.3em + }, + /pgfplots/x coord trafo/.code={}, + /pgfplots/x coord inv trafo/.code={}, + /pgfplots/y coord trafo/.code={}, + /pgfplots/y coord inv trafo/.code={}, +} + +{ +\pgfkeysdef{/pgfplots/empty command key}{}% +\pgfkeysgetvalue{/pgfplots/empty command key/.@cmd}\pgfplots@loc@TMPa +\global\let\pgfplots@empty@command@key=\pgfplots@loc@TMPa +} + +\def\pgfplots@cmdkey@alias#1=#2;{% + \pgfkeysgetvalue{/pgfplots/#2/.@cmd}\pgfplots@glob@TMPa + \pgfkeyslet{/pgfplots/#1/.@cmd}\pgfplots@glob@TMPa +}% +\pgfplots@cmdkey@alias xlabel style=x label style; +\pgfplots@cmdkey@alias ylabel style=y label style; +\pgfplots@cmdkey@alias xticklabel style=x tick label style; +\pgfplots@cmdkey@alias yticklabel style=y tick label style; +%\pgfplots@cmdkey@alias xtick scale label style=x tick scale label style; +%\pgfplots@cmdkey@alias ytick scale label style=y tick scale label style; +\pgfplots@cmdkey@alias xtick style=x tick style; +\pgfplots@cmdkey@alias ytick style=y tick style; + +\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{% + \global\pgfplotslistnewempty\pgfplots@glob@TMPa + \begingroup + \foreach \pgfplots@i in {#1} {% + \expandafter\pgfplotslistpushbackglobal\pgfplots@i\to\pgfplots@glob@TMPa + }% + \endgroup + \pgfplotslistcopy\pgfplots@glob@TMPa\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 + \edef\pgfplots@loc@TMPa{\csname pgfplots@#1min\endcsname}% + \expandafter\pgfmathfloatparsenumber\expandafter{\pgfplots@loc@TMPa}% + \let\pgfplots@cur@min@unscaled=\pgfmathresult + \edef\pgfplots@loc@TMPa{\csname pgfplots@#1max\endcsname}% + \expandafter\pgfmathfloatparsenumber\expandafter{\pgfplots@loc@TMPa}% + \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@glob@TMPa{\pgfplots@scale@ticks@above@exponent}% + \expandafter\ifnum\pgfplots@glob@TMPa<\pgfmathfloat@b@E + % ok, scale it: + \multiply\pgfmathfloat@b@E by-1 + \xdef\pgfplots@glob@TMPa{\the\pgfmathfloat@b@E}% + \else + \xdef\pgfplots@glob@TMPa{\pgfplots@scale@ticks@below@exponent}% + \expandafter\ifnum\pgfplots@glob@TMPa>\pgfmathfloat@b@E + % ok, scale it: + \multiply\pgfmathfloat@b@E by-1 + \xdef\pgfplots@glob@TMPa{\the\pgfmathfloat@b@E}% + \else + % no scaling necessary: + \xdef\pgfplots@glob@TMPa{0}% + \fi + \fi + \endgroup + \expandafter\let\csname pgfplots@tick@scale@#1\endcsname=\pgfplots@glob@TMPa% +} + +% x-axis tick labels for #1th tick +% #1: the axis (x or y) +% #2: the value +% #3,#4: coordinates for tikz +% #5: ticknumber +\def\pgfplots@show@ticklabel#1#2(#3,#4)#5{{% + \csname ifpgfplots@#1ticklabel@interval\endcsname + \pgfmathparse{#3}% + \edef\pgfplots@show@ticklabel@coord@x@new{\pgfmathresult pt}% + \pgfmathparse{#4}% + \edef\pgfplots@show@ticklabel@coord@y@new{\pgfmathresult pt}% + % + \pgfplots@show@ticklabel@{#1}{#2}% + \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@#1\endcsname + \csname pgfplots@show@ticklabel@coord@#1@new\endcsname)}% + \expandafter\edef\csname pgfplots@show@ticklabel@coord@#1\endcsname{\pgfmathresult pt}% + \let\ticknum=\pgfplots@show@ticklabel@num\relax% + \let\tick=\pgfplots@show@ticklabel@tick% + \edef\pgfplots@loc@TMPa{at (\pgfplots@show@ticklabel@coord@x,\pgfplots@show@ticklabel@coord@y)}% + \expandafter\node\pgfplots@loc@TMPa + {\csname pgfplots@#1ticklabel\endcsname};% + \fi + \xdef\pgfplots@show@ticklabel@LASTTICK{% + \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\edef\noexpand\pgfplots@show@ticklabel@num{#5}% + }% + \else + \let\ticknum=#5\relax% + \pgfplots@show@ticklabel@{#1}{#2}% + \node at (#3,#4) {\csname pgfplots@#1ticklabel\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}% + \pgfplots@if{pgfplots@scaled@ticks@#1}{% + \expandafter\pgfmathfloatshift@\expandafter{\pgfmathresult}{\csname pgfplots@tick@scale@#1\endcsname}% + }\relax + % .. and this here provides \tick as fixed point repr: + \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}% + \let\tick=\pgfmathresult + \else + \edef\tick{#2}% + \pgfplots@if{pgfplots@#1islinear}{% + \pgfplots@if{pgfplots@scaled@ticks@#1}{% + \pgfmathfloatparsenumber{#2}% + \expandafter\pgfmathfloatshift@\expandafter{\pgfmathresult}{\csname pgfplots@tick@scale@#1\endcsname}% + \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}% + \let\tick=\pgfmathresult + }{}% + }{}% + \fi + \pgfkeysgetvalue{/pgfplots/#1 coord inv trafo/.@cmd}\pgfplots@loc@TMPa + \ifx\pgfplots@loc@TMPa\pgfplots@empty@command@key + \else + \let\pgfmathresult=\tick% + \expandafter\pgfplots@loc@TMPa\expandafter{\tick}\pgfeov + \let\tick=\pgfmathresult + \fi +}% + +\def\pgfplots@user@ticklabel@list@x{% + \pgfplotslistselectorempty\ticknum\of\pgfplots@xticklabels\to\tick + \tick +} +\def\pgfplots@user@ticklabel@list@y{% + \pgfplotslistselectorempty\ticknum\of\pgfplots@yticklabels\to\tick + \tick +} +\def\pgfplots@user@extra@ticklabel@list@x{% + \pgfplotslistselectorempty\ticknum\of\pgfplots@extra@xticklabels\to\tick + \tick +} +\def\pgfplots@user@extra@ticklabel@list@y{% + \pgfplotslistselectorempty\ticknum\of\pgfplots@extra@yticklabels\to\tick + \tick +} + + +% #1 axis (x or y) +% #2 the label +\def\pgfplots@show@label#1#2{% + \node + [/pgfplots/every axis label,% + /pgfplots/every axis #1 label] + {#2}; +} + +\def\pgfplots@show@title#1{% + \node% + [/pgfplots/every axis title] + {#1}; +} + +% 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 +} + +% Fills the macros +% \pgfplots@tick@beg@a \pgfplots@tick@end@a +% \pgfplots@tick@beg@b \pgfplots@tick@end@b +% with coordinates such that +% (\pgfplots@tick@beg@a,\pgfplots@tmpa) -- (\pgfplots@tick@end@a,\pgfplots@tmpa) +% produces a correct tick line. +% +% The '@b' variant is only used in case of \pgfplots@ytickposnum = 0 +% +% #1 : the current axis (x or y). +% #2 : the axis which is NOT fixed. For x tick lines, this is the y +% axis and for y tick lines, this is the x axis (#1 = x or y) +% #3 : the current tick width +\def\pgfplots@prepare@tick@offsets@for@#1#2#3{% + \ifcase\csname pgfplots@#1tickposnum\endcsname\relax + %(\pgfplots@xcoordminTEX-\pgfplots@tick@offset, \pgfplots@tmpa) -- ++( #3, 0pt) + \edef\pgfplots@tick@beg@a{\pgf@sys@tonumber{\csname pgfplots@#2coordminTEX\endcsname}}% + \pgfmathsubtract@{\pgfplots@tick@beg@a}{\pgfplots@tick@offset}% + \let\pgfplots@tick@beg@a=\pgfmathresult + \pgfmathadd@{\pgfplots@tick@beg@a}{#3}% + \edef\pgfplots@tick@beg@a{\pgfplots@tick@beg@a pt}% + \edef\pgfplots@tick@end@a{\pgfmathresult pt}% + % + %(\pgfplots@xcoordmaxTEX+\pgfplots@tick@offset, \pgfplots@tmpa) -- ++(-#3, 0pt) + \edef\pgfplots@tick@beg@b{\pgf@sys@tonumber{\csname pgfplots@#2coordmaxTEX\endcsname}}% + \pgfmathadd@{\pgfplots@tick@beg@b}{\pgfplots@tick@offset}% + \let\pgfplots@tick@beg@b=\pgfmathresult + \pgfmathsubtract@{\pgfplots@tick@beg@b}{#3}% + \edef\pgfplots@tick@beg@b{\pgfplots@tick@beg@b pt}% + \edef\pgfplots@tick@end@b{\pgfmathresult pt}% + \or + % (\pgfplots@xcoordminTEX-\pgfplots@tick@offset, \pgfplots@tmpa) -- ++( #3, 0pt); + \edef\pgfplots@tick@beg@a{\pgf@sys@tonumber{\csname pgfplots@#2coordminTEX\endcsname}}% + \pgfmathsubtract@{\pgfplots@tick@beg@a}{\pgfplots@tick@offset}% + \let\pgfplots@tick@beg@a=\pgfmathresult + \pgfmathadd@{\pgfplots@tick@beg@a}{#3}% + \edef\pgfplots@tick@beg@a{\pgfplots@tick@beg@a pt}% + \edef\pgfplots@tick@end@a{\pgfmathresult pt}% + \or + % (\pgfplots@ZERO@x -\pgfplots@tick@offset, \pgfplots@tmpa) -- ++( #3, 0pt); + \pgf@xa=\csname pgfplots@ZERO@#2\endcsname + \edef\pgfplots@loc@TMPa{\pgf@sys@tonumber{\pgf@xa}}% + \pgfmathsubtract@{\pgfplots@loc@TMPa}{\pgfplots@tick@offset}% + \let\pgfplots@tick@beg@a=\pgfmathresult + \pgfmathadd@{\pgfplots@tick@beg@a}{#3}% + \edef\pgfplots@tick@beg@a{\pgfplots@tick@beg@a pt}% + \edef\pgfplots@tick@end@a{\pgfmathresult pt}% + \or + % (\pgfplots@xcoordmaxTEX+\pgfplots@tick@offset, \pgfplots@tmpa) -- ++(-#3, 0pt); + \edef\pgfplots@tick@beg@a{\pgf@sys@tonumber{\csname pgfplots@#2coordmaxTEX\endcsname}}% + \pgfmathadd@{\pgfplots@tick@beg@a}{\pgfplots@tick@offset}% + \let\pgfplots@tick@beg@a=\pgfmathresult + \pgfmathsubtract@{\pgfplots@tick@beg@a}{#3}% + \edef\pgfplots@tick@beg@a{\pgfplots@tick@beg@a pt}% + \edef\pgfplots@tick@end@a{\pgfmathresult pt}% + \fi +}% + +\def\pgfplots@drawyaxis@placecomputedtick{% + \pgfpathmoveto{\pgfqpoint{\pgfplots@tick@beg@a}{\pgfplots@tmpa}}% + \pgfpathlineto{\pgfqpoint{\pgfplots@tick@end@a}{\pgfplots@tmpa}}% + \ifnum\pgfplots@ytickposnum=0\relax + \pgfpathmoveto{\pgfqpoint{\pgfplots@tick@beg@b}{\pgfplots@tmpa}}% + \pgfpathlineto{\pgfqpoint{\pgfplots@tick@end@b}{\pgfplots@tmpa}}% + \fi +}% +\def\pgfplots@drawyaxis@placecomputedgridline{% + \pgfpathmoveto{\pgfqpoint{\pgfplots@xcoordminTEX}{\pgfplots@tmpa}}% + \pgfpathlineto{\pgfqpoint{\pgfplots@xcoordmaxTEX}{\pgfplots@tmpa}}% +}% + +\newif\ifpgfplots@needsminorloop + +\def\pgfplots@draw@tick@scale@label@for#1{% + \csname ifpgfplots@#1islinear\endcsname + \pgfplots@if{pgfplots@scaled@ticks@#1}{% + \begingroup + \xdef\pgfplots@glob@TMPa{\csname pgfplots@tick@scale@#1\endcsname}% + \expandafter\c@pgf@counta\pgfplots@glob@TMPa\relax + \multiply\c@pgf@counta by-1 + \ifnum\c@pgf@counta=0\relax + \global\let\pgfplots@glob@TMPa=\pgfutil@empty + \else + \xdef\pgfplots@glob@TMPa{\the\c@pgf@counta}% + \fi + \endgroup + \ifx\pgfplots@glob@TMPa\pgfutil@empty + \else + \edef\pgfplots@tick@scale@labels{\noexpand\pgfplots@invoke@pgfkeyscode{/pgfplots/tick scale label code/.@cmd}{\pgfplots@glob@TMPa}}% + \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 + }{\relax}% + \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 the current tick position, stored in \pgfplots@tmpa, +% does not cross the y-axis. +% +% This is just a special case for centered axis lines. +\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{% + \pgfpathmoveto{\pgfqpoint{\pgfplots@tmpa}{\pgfplots@tick@beg@a}}% + \pgfpathlineto{\pgfqpoint{\pgfplots@tmpa}{\pgfplots@tick@end@a}}% + \ifnum\pgfplots@xtickposnum=0\relax + \pgfpathmoveto{\pgfqpoint{\pgfplots@tmpa}{\pgfplots@tick@beg@b}}% + \pgfpathlineto{\pgfqpoint{\pgfplots@tmpa}{\pgfplots@tick@end@b}}% + \fi +}% +\def\pgfplots@drawxaxis@placecomputedgridline{% + \pgfpathmoveto{\pgfqpoint{\pgfplots@tmpa}{\pgfplots@ycoordminTEX}}% + \pgfpathlineto{\pgfqpoint{\pgfplots@tmpa}{\pgfplots@ycoordmaxTEX}}% +}% + +% #1: axis (x or y) +% #2: axis index (0 or 1) +% #3: tick position list +\def\pgfplots@draw@extra@ticks@for#1#2#3{% + \begingroup + \pgfplots@scaled@ticks@xfalse + \pgfplots@scaled@ticks@yfalse + \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 + \pgfplotsset{/pgfplots/every extra #1 tick}% FIXME : used 'search path for tikz' before... + \pgfplots@prepare@ticks@for{#3}{#1}{#2}% + \pgfplots@drawgridlines@for{#1}{#2}% + \pgfplots@drawticklines@for{#1}{#2}% + \pgfplots@drawticklabels@for{#1}{#2}% + \endgroup +} + +\def\pgfplots@drawaxis@innerlines{% + \ifpgfplots@hide@y\else + \ifnum\pgfplots@yaxislinesnum=2 + \draw[/pgfplots/every inner y axis line,% + decorate,% + ydiscont,% + decoration={pre length=\ydisstart, post length=\ydisend}] + (\pgfplots@ZERO@x, \pgfplots@ycoordminTEX) -- (\pgfplots@ZERO@x, \pgfplots@ycoordmaxTEX); + \fi + \fi + \ifpgfplots@hide@x\else + \ifnum\pgfplots@xaxislinesnum=2 + \draw[/pgfplots/every inner x axis line,% + decorate,% + xdiscont,% + decoration={pre length=\xdisstart, post length=\xdisend}] + (\pgfplots@xcoordminTEX, \pgfplots@ZERO@y) -- (\pgfplots@xcoordmaxTEX, \pgfplots@ZERO@y); + \fi + \fi +}% + +% Ok, we don't mind whether edges with thick lines look ugly. We just +% draw separate lines. This here is necessary if we want arrow heads. +\def\pgfplots@drawaxis@outerlines@separate{% + \ifpgfplots@hide@x + \else + \scope[/pgfplots/every outer x axis line, + xdiscont,decoration={pre length=\xdisstart, post length=\xdisend}] + \ifcase\pgfplots@xaxislinesnum + \draw decorate { + (\pgfplots@xcoordminTEX,\pgfplots@ycoordminTEX) + -- (\pgfplots@xcoordmaxTEX,\pgfplots@ycoordminTEX) }; + \draw decorate { + (\pgfplots@xcoordminTEX,\pgfplots@ycoordmaxTEX) + -- (\pgfplots@xcoordmaxTEX,\pgfplots@ycoordmaxTEX) }; + + \or + \draw decorate { + (\pgfplots@xcoordminTEX,\pgfplots@ycoordminTEX) + -- (\pgfplots@xcoordmaxTEX,\pgfplots@ycoordminTEX) }; + \or + \or + \draw decorate { + (\pgfplots@xcoordminTEX,\pgfplots@ycoordmaxTEX) + -- (\pgfplots@xcoordmaxTEX,\pgfplots@ycoordmaxTEX) }; + + \fi + \endscope + \fi + \ifpgfplots@hide@y + \else + \scope[/pgfplots/every outer y axis line, + ydiscont,decoration={pre length=\ydisstart, post length=\ydisend}] + \ifcase\pgfplots@yaxislinesnum + \draw decorate { + (\pgfplots@xcoordminTEX,\pgfplots@ycoordminTEX) + -- (\pgfplots@xcoordminTEX,\pgfplots@ycoordmaxTEX) }; + \draw decorate { + (\pgfplots@xcoordmaxTEX,\pgfplots@ycoordminTEX) + -- (\pgfplots@xcoordmaxTEX,\pgfplots@ycoordmaxTEX) }; + + \or + \draw decorate { + (\pgfplots@xcoordminTEX,\pgfplots@ycoordminTEX) + -- (\pgfplots@xcoordminTEX,\pgfplots@ycoordmaxTEX) }; + \or + \or + \draw decorate { + (\pgfplots@xcoordmaxTEX,\pgfplots@ycoordminTEX) + -- (\pgfplots@xcoordmaxTEX,\pgfplots@ycoordmaxTEX) }; + + \fi + \endscope + \fi +}% + +% This here is complicated: we try to create good edges and draw a +% SINGLE path for the partial or complete rectangle +% +% ----- +% | | +% | | +% ----- +\def\pgfplots@drawaxis@outerlines@cycledpath{% + \draw[ + /pgfplots/every outer x axis line, % FIXME! these outer styles need much more attention :-( + /pgfplots/every outer y axis line] + (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX) +\ifpgfplots@hide@y + { (\pgfplots@xcoordminTEX, \pgfplots@ycoordmaxTEX) } +\else + \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 +\fi +\ifpgfplots@hide@x + { (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX) } +\else + \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 +\fi +\ifpgfplots@hide@y + { (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordminTEX) } +\else + \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 +\fi +\ifpgfplots@hide@x + { (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX) } +\else + \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% can't use cycle here! +\fi + ; % -- cycle; +}% + +\def\pgfplots@drawaxis@outerlines{% + \ifnum\pgfplots@xaxislinesnum>0 + \pgfplots@separate@axis@linestrue + \fi + \ifnum\pgfplots@yaxislinesnum>0 + \pgfplots@separate@axis@linestrue + \fi + \ifpgfplots@separate@axis@lines + \pgfplots@drawaxis@outerlines@separate + \else + \pgfplots@drawaxis@outerlines@cycledpath + \fi +}% + +\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@glob@TMPa{% + \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@glob@TMPa + \pgfplots@drawaxis@outerlines% + \pgfplots@drawaxis@innerlines% + \endgroup +}% + +% Computes final major and minor tick positions into global lists +% \pgfplots@prepared@tick@positions@major@x +% and +% \pgfplots@prepared@tick@positions@minor@x. +% +% The major tick list contains tuples (canvas position,logical position) +% while the minor tick list contains just the canvas position. +% +% #1: the tick list. +% #2: the axis name as character, i.e. 'x' or 'y' +% #3: the axis name as integer, i.e. 0 or 1 +\def\pgfplots@prepare@ticks@for#1#2#3{% + \begingroup + \expandafter\let\expandafter\ifpgfplots@islinear\csname ifpgfplots@#2islinear\endcsname + \expandafter\let\expandafter\ifpgfplots@minorticks\csname ifpgfplots@#2minorticks\endcsname + \expandafter\let\expandafter\ifpgfplots@minorgrids\csname ifpgfplots@#2minorgrids\endcsname + % these lists need to be global such that I can fill them inside + % of \foreach statements. And, yes: I have also added a TeX group + % on my own (but that's not the problem). + \global\pgfplotslistnewempty\pgfplots@prepared@tick@positions@major + \global\pgfplotslistnewempty\pgfplots@prepared@tick@positions@minor + \edef\pgfplots@loc@TMPa{#1}% + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \ifpgfplots@minorticks + \pgfplots@needsminorlooptrue + \else + \ifpgfplots@minorgrids + \pgfplots@needsminorlooptrue + \else + \pgfplots@needsminorloopfalse + \fi + \fi + \ifpgfplots@needsminorloop + \ifpgfplots@islinear + \expandafter\let\expandafter\pgfplots@minor@tick@num\csname pgfplots@minor@#2tick@num\endcsname + \begingroup + \c@pgf@counta=\pgfplots@minor@tick@num\relax + \advance\c@pgf@counta by1\relax + \pgfplots@tmpa=\csname pgfplots@tick@distance@#2\endcsname pt + \divide\pgfplots@tmpa by\c@pgf@counta + \edef\pgfmathresult{\pgf@sys@tonumber{\pgfplots@tmpa}}% + \pgfmath@smuggleone\pgfmathresult + \endgroup + \let\pgfplots@minor@tick@dist=\pgfmathresult + \else + \def\pgfplots@minor@tick@num{9}% + \fi + \fi + \foreach \x in {#1} {% + \ifcase#3\relax + \pgfextractx{\pgfplots@tmpa}{\pgfpointxy{\x}{0}}% + \or + \pgfextracty{\pgfplots@tmpa}{\pgfpointxy{0}{\x}}% + \fi + \csname pgfplots@#2tick@check@tickshow\endcsname + % + \ifpgfplots@tickshow + \ifdim\pgfplots@tmpa<\csname pgfplots@#2coordminTEX\endcsname + \else + \ifdim\pgfplots@tmpa>\csname pgfplots@#2coordmaxTEX\endcsname + \else + \edef\pgfplots@loc@TMPa{{\the\pgfplots@tmpa}{\x}}% + \expandafter\pgfplotslistpushbackglobal\pgfplots@loc@TMPa\to\pgfplots@prepared@tick@positions@major + \fi + \fi + \fi + % X-Axis ticks bottom and top + % in log: + % log( i*10^k ) = log\pgfplots@i + k\log10 -> draw ticks for i=1..9 + \ifpgfplots@needsminorloop + \foreach \pgfplots@i in {1,...,\pgfplots@minor@tick@num} {% + \begingroup + \ifcase#3\relax + \ifpgfplots@islinear + \pgfextractx{\pgfplots@tmpa}{\pgfpointxy{\pgfplots@i*\pgfplots@minor@tick@dist}{0}}% + \else + \pgfextractx{\pgfplots@tmpa}{\pgfpointxy{\logi\pgfplots@i}{0}}% + \fi + \or + \ifpgfplots@islinear + \pgfextracty{\pgfplots@tmpa}{\pgfpointxy{0}{\pgfplots@i*\pgfplots@minor@tick@dist}}% + \else + \pgfextracty{\pgfplots@tmpa}{\pgfpointxy{0}{\logi\pgfplots@i}}% + \fi + \fi + \edef\pgfmathresult{\the\pgfplots@tmpa}% + \pgfmath@smuggleone\pgfmathresult + \endgroup + \advance\pgfplots@tmpa by\pgfmathresult\relax + \ifdim\pgfplots@tmpa<\csname pgfplots@#2coordminTEX\endcsname + \else + \ifdim\pgfplots@tmpa>\csname pgfplots@#2coordmaxTEX\endcsname + \else + \expandafter\pgfplotslistpushbackglobal\the\pgfplots@tmpa\to\pgfplots@prepared@tick@positions@minor + \fi + \fi + }% + \fi + }% + \fi + \endgroup + \expandafter\let\csname pgfplots@prepared@tick@positions@minor@#2\endcsname=\pgfplots@prepared@tick@positions@minor + \expandafter\let\csname pgfplots@prepared@tick@positions@major@#2\endcsname=\pgfplots@prepared@tick@positions@major + \global\let\pgfplots@prepared@tick@positions@major=\relax + \global\let\pgfplots@prepared@tick@positions@minor=\relax +}% + +% Converts the tuples in major tick lists into two separate variables. +% +% Usage: +% \pgfplotslistforeach\pgfplots@prepared@tick@positions@major@x\as\curelement{% +% \expandafter\pgfplots@parse@prepared@major@tickpos\curelement\canvas\logical +% } +% +% #1#2 : the tuples as they are found in the prepared major tick list, +% #3 : a dimen register which will be filled with #1 +% #4 : a macro which will be assigned with #2 +\def\pgfplots@parse@prepared@major@tickpos#1#2#3#4{% + #3=#1\relax% + \def#4{#2}% +}% + + +% #1 : the verbatim axis name (either 'x' or 'y') +% #2 : the index of the axis (either 0 or 1) +\def\pgfplots@drawgridlines@for#1#2{% + \begingroup + \expandafter\let\expandafter\ifpgfplots@major\csname ifpgfplots@#1majorgrids\endcsname + \expandafter\let\expandafter\ifpgfplots@minor\csname ifpgfplots@#1minorgrids\endcsname + \expandafter\let\expandafter\pgfplots@prepared@tick@positions@major@\csname pgfplots@prepared@tick@positions@major@#1\endcsname + \expandafter\let\expandafter\pgfplots@prepared@tick@positions@minor@\csname pgfplots@prepared@tick@positions@minor@#1\endcsname + \pgfplots@loop@CONTINUEfalse + \ifpgfplots@major + \pgfplots@loop@CONTINUEtrue + \fi + \ifpgfplots@minor + \pgfplots@loop@CONTINUEtrue + \fi + \ifpgfplots@loop@CONTINUE + \scope + %\clip (\pgfplots@xcoordminTEX\pgfplots@leftover, \pgfplots@ycoordminTEX\pgfplots@leftover) + % rectangle (\pgfplots@xcoordmaxTEX\pgfplots@rightover, \pgfplots@ycoordmaxTEX\pgfplots@rightover); + \pgfinterruptboundingbox% + \ifcase#2\relax + \clip (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX-5cm) + rectangle (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX+5cm); + \or + \clip (\pgfplots@xcoordminTEX-5cm, \pgfplots@ycoordminTEX) + rectangle (\pgfplots@xcoordmaxTEX+5cm, \pgfplots@ycoordmaxTEX); + \fi + \endpgfinterruptboundingbox% + \ifpgfplots@major + \draw[% + /pgfplots/every axis grid, + /pgfplots/every major grid, + /pgfplots/every axis #1 grid, + /pgfplots/every major #1 grid]% + \pgfextra + \pgfplotslistforeach\pgfplots@prepared@tick@positions@major@\as\pgfplots@curgridpos{% + \expandafter\pgfplots@parse@prepared@major@tickpos\pgfplots@curgridpos\pgfplots@tmpa\pgfplots@curgridpos + \csname pgfplots@draw#1axis@placecomputedgridline\endcsname + }% + \endpgfextra; + \fi + % + \ifpgfplots@minor + \draw[% + /pgfplots/every axis grid, + /pgfplots/every minor grid, + /pgfplots/every axis #1 grid, + /pgfplots/every minor #1 grid]% + \pgfextra + \pgfplotslistforeach\pgfplots@prepared@tick@positions@minor@\as\pgfplots@curgridpos{% + \pgfplots@tmpa=\pgfplots@curgridpos + \csname pgfplots@draw#1axis@placecomputedgridline\endcsname + }% + \endpgfextra; + \fi + \endscope + \fi + \endgroup +} + +% #1 : the verbatim axis name (either 'x' or 'y') +% #2 : the index of the axis (either 0 or 1) +\def\pgfplots@drawticklines@for#1#2{% + \scope + \expandafter\let\expandafter\ifpgfplots@major\csname ifpgfplots@#1majorticks\endcsname + \expandafter\let\expandafter\ifpgfplots@minor\csname ifpgfplots@#1minorticks\endcsname + \expandafter\let\expandafter\pgfplots@prepared@tick@positions@major@\csname pgfplots@prepared@tick@positions@major@#1\endcsname + \expandafter\let\expandafter\pgfplots@prepared@tick@positions@minor@\csname pgfplots@prepared@tick@positions@minor@#1\endcsname + %\clip (\pgfplots@xcoordminTEX\pgfplots@leftover, \pgfplots@ycoordminTEX\pgfplots@leftover) + % rectangle (\pgfplots@xcoordmaxTEX\pgfplots@rightover, \pgfplots@ycoordmaxTEX\pgfplots@rightover); + \pgfinterruptboundingbox% + \ifcase#2\relax + \clip (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX-5cm) + rectangle (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX+5cm); + \or + \clip (\pgfplots@xcoordminTEX-5cm, \pgfplots@ycoordminTEX) + rectangle (\pgfplots@xcoordmaxTEX+5cm, \pgfplots@ycoordmaxTEX); + \fi + \endpgfinterruptboundingbox% + \ifpgfplots@major + \draw[% + /pgfplots/every tick, + /pgfplots/every major tick, + /pgfplots/every #1 tick, + /pgfplots/every major #1 tick]% + \pgfextra + \pgfmathparse{\pgfplots@tickwidth}% + \let\pgfplots@tickwidth@=\pgfmathresult + \edef\pgfplots@tickwidth{\pgfplots@tickwidth@ pt}% + \ifcase\csname pgfplots@#1tickalignnum\endcsname\relax + \def\pgfplots@tick@offset{0} + \or + \let\pgfplots@tick@offset=\pgfplots@tickwidth@% + \or + \pgfmathmultiply@{0.5}{\pgfplots@tickwidth@}% + \let\pgfplots@tick@offset=\pgfmathresult% + \fi + \ifcase#2\relax + \pgfplots@prepare@tick@offsets@for@{#1}{y}{\pgfplots@tickwidth@}% + \else + \pgfplots@prepare@tick@offsets@for@{#1}{x}{\pgfplots@tickwidth@}% + \fi + \pgfplotslistforeach\pgfplots@prepared@tick@positions@major@\as\pgfplots@curtickpos{% + \expandafter\pgfplots@parse@prepared@major@tickpos\pgfplots@curtickpos\pgfplots@tmpa\pgfplots@curtickpos + \csname pgfplots@draw#1axis@placecomputedtick\endcsname + }% + \endpgfextra; + \fi + % + \ifpgfplots@minor + \draw[% + /pgfplots/every tick, + /pgfplots/every minor tick, + /pgfplots/every #1 tick, + /pgfplots/every minor #1 tick]% + \pgfextra + \pgfmathparse{\pgfplots@subtickwidth}% + \let\pgfplots@subtickwidth@=\pgfmathresult + \edef\pgfplots@subtickwidth{\pgfplots@subtickwidth@ pt}% + \ifcase\csname pgfplots@#1tickalignnum\endcsname\relax + \def\pgfplots@tick@offset{0}% + \or + \let\pgfplots@tick@offset=\pgfplots@subtickwidth@% + \or + \pgfmathmultiply@{0.5}{\pgfplots@subtickwidth@}% + \let\pgfplots@tick@offset=\pgfmathresult% + \fi + \ifcase#2\relax + \pgfplots@prepare@tick@offsets@for@{#1}{y}{\pgfplots@subtickwidth@}% + \else + \pgfplots@prepare@tick@offsets@for@{#1}{x}{\pgfplots@subtickwidth@}% + \fi + \pgfplotslistforeach\pgfplots@prepared@tick@positions@minor@\as\pgfplots@curtickpos{% + \pgfplots@tmpa=\pgfplots@curtickpos + \csname pgfplots@draw#1axis@placecomputedtick\endcsname + }% + \endpgfextra; + \fi + \endscope +} + +% #1 : the verbatim axis name (either 'x' or 'y') +% #2 : the index of the axis (either 0 or 1) +\def\pgfplots@drawticklabels@for#1#2{% + \begingroup + \expandafter\let\expandafter\ifpgfplots@major\csname ifpgfplots@#1majorticks\endcsname + \expandafter\let\expandafter\ifpgfplots@islinear\csname ifpgfplots@#1islinear\endcsname + \expandafter\let\expandafter\pgfplots@prepared@tick@positions@major@\csname pgfplots@prepared@tick@positions@major@#1\endcsname + \ifpgfplots@major + \ifpgfplots@islinear + \pgfplots@if{pgfplots@scaled@ticks@#1}{% + \pgfplots@init@scaled@tick@for{#1}% + }\relax% + \fi + \begingroup + \pgfkeys{/tikz/every node/.append style={/pgfplots/every tick label,/pgfplots/every #1 tick label}}% + \ifcase\csname pgfplots@#1tickalignnum\endcsname\relax + \def\pgfmathresult{0}% + \or + \pgfmathparse{\pgfplots@tickwidth}% + \or + \pgfmathmultiply{0.5}{\pgfplots@tickwidth}% + \fi + \let\pgfplots@tick@offset=\pgfmathresult + \ifnum\csname pgfplots@#1ticklabelposnum\endcsname=0 + % the choice '[xy]ticklabel pos=default': + \expandafter\let\expandafter\pgfplots@tmpposnum\csname pgfplots@#1tickposnum\endcsname + \else + \expandafter\let\expandafter\pgfplots@tmpposnum\csname pgfplots@#1ticklabelposnum\endcsname + \fi + \ifcase#2\relax + \ifcase\pgfplots@tmpposnum\relax + \edef\pgfplots@tick@origin{\pgf@sys@tonumber{\pgfplots@ycoordminTEX}}% + \or + \edef\pgfplots@tick@origin{\pgf@sys@tonumber{\pgfplots@ycoordminTEX}}% + \or + \pgf@xa=\pgfplots@ZERO@y + \edef\pgfplots@tick@origin{\pgf@sys@tonumber{\pgf@xa}}% + \or + \edef\pgfplots@tick@origin{\pgf@sys@tonumber{\pgfplots@ycoordmaxTEX}}% + \fi + \def\pgfplots@tickposchoicea{\tikzset{above}}% + \def\pgfplots@tickposchoiceb{\tikzset{below}}% + \or + \ifcase\pgfplots@tmpposnum\relax + \edef\pgfplots@tick@origin{\pgf@sys@tonumber{\pgfplots@xcoordminTEX}}% + \or + \edef\pgfplots@tick@origin{\pgf@sys@tonumber{\pgfplots@xcoordminTEX}}% + \or + \pgf@xa=\pgfplots@ZERO@x + \edef\pgfplots@tick@origin{\pgf@sys@tonumber{\pgf@xa}}% + \or + \edef\pgfplots@tick@origin{\pgf@sys@tonumber{\pgfplots@xcoordmaxTEX}}% + \fi + \def\pgfplots@tickposchoicea{\tikzset{right}}% + \def\pgfplots@tickposchoiceb{\tikzset{left}}% + \fi + \ifnum\pgfplots@tmpposnum=3 + \pgfplots@tickposchoicea + \pgfmathadd@{\pgfplots@tick@origin}{\pgfplots@tick@offset}% + \else + \pgfplots@tickposchoiceb + \pgfmathsubtract@{\pgfplots@tick@origin}{\pgfplots@tick@offset}% + \fi + \edef\pgfplots@tick@origin{\pgfmathresult pt}% + \def\pgfplots@ticknum{0}% + \xdef\pgfplots@show@ticklabel@LASTTICK{}% + \pgfplotslistforeachungrouped\pgfplots@prepared@tick@positions@major@\as\pgfplots@curtickpos{% + \expandafter\pgfplots@parse@prepared@major@tickpos\pgfplots@curtickpos\pgfplots@tmpa\pgfplots@curtickpos + \ifcase#2\relax + \pgfplots@show@ticklabel + {#1}{\pgfplots@curtickpos}(\pgfplots@tmpa,\pgfplots@tick@origin)% + {\pgfplots@ticknum}% + \or + \pgfplots@show@ticklabel + {#1}{\pgfplots@curtickpos}(\pgfplots@tick@origin,\pgfplots@tmpa)% + {\pgfplots@ticknum}% + \fi + \begingroup + \c@pgf@counta=\pgfplots@ticknum\relax + \advance\c@pgf@counta by1 + \edef\pgfplots@ticknum{\the\c@pgf@counta}% + \pgfmath@smuggleone\pgfplots@ticknum + \endgroup + }% + \endgroup + \pgfplots@draw@tick@scale@label@for #1% + \fi + \endgroup +} + +\def\pgfplots@rememberplotspec#1{% + \pgfplotslistpushbackglobal{#1}\to\pgfplots@plotspeclist +} + +\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. +% +% \addplot[<style options>] plot[<behavior options>] <input type and args> <post plot path> ; +% +% +% The linespec. will be used in the legend. +% +% Low-level implementation: +% +% \pgfplots@addplot +% \pgfplots@addplotimpl +% \pgfplots@start@plot@with@behavioroptions <--- \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@behavioroptions{#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! Ignoring it.}% + \pgfplots@gobble@until@semicolon + }% + }% + }% + }% +} + +\def\pgfplots@gobble@until@semicolon#1;{} + +% 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! +% +\long\def\pgfplots@addplotimpl@expression#1(#2,#3)#4;{% + \pgfplots@PREPARE@COORD@STREAM{#1}{#4}% + % + \pgfplots@gettikzinternal@keyval{variable}{tikz@plot@var}{\x}% + \pgfplots@gettikzinternal@keyval{samples at}{tikz@plot@samplesat}{-5,-4.6,...,5}% + % + \edef\pgfplots@plot@data{\noexpand\foreach\expandafter\noexpand\tikz@plot@var in {\tikz@plot@samplesat}}% + \pgfplotsapplistXXglobalnewempty + \pgfplots@plot@data{% + \pgfmathparse{#2}% + \let\pgfplots@current@point@x=\pgfmathresult + \pgfmathparse{#3}% + \let\pgfplots@current@point@y=\pgfmathresult + \edef\pgfplots@loc@TMPa{(\pgfplots@current@point@x,\pgfplots@current@point@y)}% + \expandafter\pgfplotsapplistXXglobalpushback\expandafter{\pgfplots@loc@TMPa}% + }% + \pgfplotsapplistXXgloballet\pgfplots@loc@TMPa + \pgfplotsapplistXXglobalclear + \expandafter\pgfplots@coord@stream@foreach\expandafter{\pgfplots@loc@TMPa}% +}% + +\def\pgfplots@addplotimpl@f#1f{% + \pgfutil@ifnextchar i{\pgfplots@addplotimpl@file{#1}}{\pgfplots@addplotimpl@function{#1}}% +}% + +\let\pgfplots@backupof@pgfplotxyfile=\pgfplotxyfile + +% the following code +% results finally in +% +% set format "%.7e";; set samples <...>; plot ... +% +% The windows port of gnuplot doesn't run without the second semicolon +% - for whatever reason. +{ + \catcode`\%=12 + \catcode`\"=12 + \xdef\pgfplots@gnuplot@format{set format "%.7e";} +} + +% #1: args of \addplot[...] +% #2: file name +% #3: trailing path commands until ';' +\def\pgfplots@addplotimpl@function#1unction#2#3;{% + \pgfplots@gettikzinternal@keyval{prefix}{tikz@plot@prefix}{\jobname.}% + \pgfplots@gettikzinternal@keyval{id}{tikz@plot@id}{pgf-plot}% + \pgfplots@gettikzinternal@keyval{samples}{tikz@plot@samples}{25}% + \pgfplots@gettikzinternal@keyval{domain}{tikz@plot@domain}{-5:5}% + \pgfplots@gettikzinternal@keyval{raw gnuplot}{iftikz@plot@raw@gnuplot}{\iffalse}% + \pgfplots@gettikzinternal@keyval{parametric}{iftikz@plot@parametric}{\iffalse}% + % + \def\pgfplots@plot@filename{\tikz@plot@prefix\tikz@plot@id}% + \iftikz@plot@raw@gnuplot% + \def\pgfplots@plot@data{\pgfplotgnuplot[\pgfplots@plot@filename]{#2}}% + \else% + \iftikz@plot@parametric% + \def\pgfplots@plot@data{\pgfplotgnuplot[\pgfplots@plot@filename]{% + \pgfplots@gnuplot@format; + set samples \tikz@plot@samples; + set parametric; + plot [t=\tikz@plot@domain] #2}}% + \else% + \def\pgfplots@plot@data{\pgfplotgnuplot[\pgfplots@plot@filename]{% + \pgfplots@gnuplot@format; + set samples \tikz@plot@samples; + plot [x=\tikz@plot@domain] #2}}% + \fi% + \fi% + \def\pgfplotxyfile{\pgfplots@addplotimpl@gnuplotresult{#1}{#3}}% + \pgfplots@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 +} + +% #1: arguments to \addplot[...] +% #2: the file name +% #3: any additional path arguments +\def\pgfplots@addplotimpl@file#1ile{% + \pgfutil@ifnextchar[{% + \pgfplots@addplotimpl@file@opt{#1}% + }{% + \pgfplots@addplotimpl@file@opt{#1}[]% + }% +} + +% \addplot[#1] file[#2] {#3} #4; +\def\pgfplots@addplotimpl@file@opt#1[#2]#3#4;{% + \begingroup + \def\pgfplots@loc@TMPa{#2}% + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \pgfqkeys{/pgfplots/plot file}{#2}% + \fi + \pgfplots@PREPARE@COORD@STREAM{#1}{#4}% + \pgfplots@coord@stream@start + \openin1=#3 + \ifeof1 + \pgfplots@warning{sorry, plot file{#3} could not be opened!?}% + \else + \pgfplots@addplotimpl@file@readall + \fi + \pgfplots@coord@stream@end + \endgroup +}% +\def\pgfplots@addplotimpl@file@readall{% + \read1 to\pgfplots@file@LINE + \expandafter\pgfplotstableread@checkspecial@line\pgfplots@file@LINE\pgfplotstable@EOI + \ifpgfplotstableread@skipline + \else + \ifpgfplots@plot@file@skipfirst + % Silently skip first data row, assuming it is a header. + \pgfplots@plot@file@skipfirstfalse + \else + \expandafter\pgfplots@addplotimpl@file@parsesingle\pgfplots@file@LINE\pgfplots@EOI + \fi + \fi + \ifeof1 + \else + \expandafter + \pgfplots@addplotimpl@file@readall + \fi +}% + +\def\pgfplots@addplotimpl@file@parsesingle#1 #2 #3\pgfplots@EOI{% + \pgfplots@coord@stream@coord{#1}{#2}{}{}% +}% + +\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@getopts#1[#2]{% + \pgfutil@ifnextchar f{% + \pgfplots@addplotimpl@table@fromstructure{#1}{#2}% + }{% + \pgfplots@addplotimpl@table@fromfile{#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@fromstructure#1#2from#3#4;{% + \begingroup + % FIXME : this thing here has runtime O(N^2) ! + % I fear it is faster to simply reload the data .... !? + % + % well, for a lot of columns which are used in different contexts + % and few rows, this here IS more efficient. + \pgfplotstableset{#2}% + \pgfplotstablecopy#3\to\pgfplots@table + \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 + % This here is just for sanity checking: if the 'y' column is + % - for whatever reasons - invalid; provide good error + % recovery. + \pgfplotslistcheckempty\addplot@tbl@y + \ifpgfplotslistempty + \pgfplots@loop@CONTINUEfalse + \else + \pgfplots@loop@CONTINUEtrue + \fi + \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@loc@TMPa{{\addplot@tbl@cur@x}{\addplot@tbl@cur@y}{\addplot@tbl@error@cur@x}{\addplot@tbl@error@cur@y}}% + \expandafter\pgfplots@coord@stream@coord\pgfplots@loc@TMPa + \else + \edef\pgfplots@loc@TMPa{{\addplot@tbl@cur@x}{\addplot@tbl@cur@y}{}{}}% + \expandafter\pgfplots@coord@stream@coord\pgfplots@loc@TMPa + \fi + \repeat + \pgfplots@coord@stream@end + \endgroup +} + + +% #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@fromfile#1#2#3#4;{% + %-------------------------------------------------- + % \begingroup + % \pgfplotstableset{#2}% + % \pgfplotstableread{#3}\pgfplots@table + % \pgfplots@addplotimpl@table@fromstructure{#1}{}from{\pgfplots@table}{#4};% + % \endgroup + %-------------------------------------------------- + \pgfplotsapplistXXglobalnewempty + \begingroup + \pgfplotstableset{#2}% + \let\pgfplots@table@PTR@x=\pgfutil@empty + \let\pgfplots@table@PTR@y=\pgfutil@empty + \ifpgfplots@errorbars@enabled + \let\pgfplots@table@ERRPTR@x=\pgfutil@empty + \let\pgfplots@table@ERRPTR@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 + \pgfplotstableread{#3} to listener\pgfplots@addplotimpl@table@fromfile@listener@witherrors + \else + \pgfplotstableread{#3} to listener\pgfplots@addplotimpl@table@fromfile@listener + \fi + \endgroup + % + \pgfplots@PREPARE@COORD@STREAM{#1}{#4}% + \pgfplotsapplistXXgloballet\pgfplots@coordlist + \pgfplotsapplistXXglobalclear + \expandafter\pgfplots@coord@stream@foreach\expandafter{\pgfplots@coordlist}%% +} +\def\pgfplots@addplotimpl@table@fromfile@listener{% + \pgfplots@addplotimpl@table@fromfile@listener@ + \edef\pgfplots@current@point{(\pgfplots@current@point@x,\pgfplots@current@point@y)}% + \expandafter\pgfplotsapplistXXglobalpushback\expandafter{\pgfplots@current@point}% +} +\def\pgfplots@addplotimpl@table@fromfile@listener@{% + \ifx\pgfplots@table@PTR@x\pgfutil@empty + % this here is only evaluated ONCE. + \ifx\pgfplots@plot@tbl@x\pgfutil@empty + \pgfplotstablereadgetptrtocolindex{\pgfplots@plot@tbl@xindex}{\pgfplots@table@PTR@x}% + \else + \pgfplotstablereadgetptrtocolname{\pgfplots@plot@tbl@x}{\pgfplots@table@PTR@x}% + \fi + \ifx\pgfplots@plot@tbl@y\pgfutil@empty + \pgfplotstablereadgetptrtocolindex{\pgfplots@plot@tbl@yindex}{\pgfplots@table@PTR@y}% + \else + \pgfplotstablereadgetptrtocolname{\pgfplots@plot@tbl@y}{\pgfplots@table@PTR@y}% + \fi + \fi + \pgfplotstablereadevalptr\pgfplots@table@PTR@x\pgfplots@current@point@x + \pgfplotstablereadevalptr\pgfplots@table@PTR@y\pgfplots@current@point@y +}% +\def\pgfplots@addplotimpl@table@fromfile@listener@witherrors{% + \pgfplots@addplotimpl@table@fromfile@listener@ + % + \ifx\pgfplots@table@ERRPTR@x\pgfutil@empty + % this here is only evaluated ONCE. + \ifx\pgfplots@plot@tbl@error@x\pgfutil@empty + \ifx\pgfplots@plot@tbl@error@xindex\pgfutil@empty + \let\pgfplots@table@ERRPTR@x=\relax% + \else + \pgfplotstablereadgetptrtocolindex{\pgfplots@plot@tbl@error@xindex}{\pgfplots@table@ERRPTR@x}% + \fi + \else + \pgfplotstablereadgetptrtocolname{\pgfplots@plot@tbl@error@x}{\pgfplots@table@ERRPTR@x}% + \fi + \ifx\pgfplots@plot@tbl@error@y\pgfutil@empty + \ifx\pgfplots@plot@tbl@error@yindex\pgfutil@empty + \let\pgfplots@table@ERRPTR@y=\relax% + \else + \pgfplotstablereadgetptrtocolindex{\pgfplots@plot@tbl@error@yindex}{\pgfplots@table@ERRPTR@y}% + \fi + \else + \pgfplotstablereadgetptrtocolname{\pgfplots@plot@tbl@error@y}{\pgfplots@table@ERRPTR@y}% + \fi + \fi + \ifx\relax\pgfplots@table@ERRPTR@x + \let\addplot@tbl@error@cur@x=\pgfutil@empty + \else + \pgfplotstablereadevalptr\pgfplots@table@ERRPTR@x\addplot@tbl@error@cur@x + \fi + \ifx\relax\pgfplots@table@ERRPTR@y + \let\addplot@tbl@error@cur@y=\pgfutil@empty + \else + \pgfplotstablereadevalptr\pgfplots@table@ERRPTR@y\addplot@tbl@error@cur@y + \fi + \edef\pgfplots@current@point{(\pgfplots@current@point@x,\pgfplots@current@point@y)+-(\addplot@tbl@error@cur@x,\addplot@tbl@error@cur@y)}% + \expandafter\pgfplotsapplistXXglobalpushback\expandafter{\pgfplots@current@point}% +}% + +% #1: arguments to \addplot plot[#1] +% -> these are called 'behavior' options in the manual; they are set +% immediately. +\def\pgfplots@start@plot@with@behavioroptions#1{% + \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 + \def\pgfplots@addplot@nonlegend@options{#1}% + \ifx\pgfplots@addplot@nonlegend@options\pgfutil@empty + \else + \pgfplotsset{#1}% + \fi + % these styles may contain behavior options (error bars, + % samples,... ) activate them! + \pgfplotsset{/pgfplots/every axis plot,/pgfplots/every axis plot no \the\pgfplots@numplots/.try}% +} + +% 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{% + \def\pgfplots@coord@stream@start@{% + \pgfplotsapplistXXnewempty + \ifpgfplots@errorbars@enabled + \pgfplots@streamerrorbar@recordto{\pgfplots@recordederrorbar}% + \pgfplots@streamerrorbarstart + \else + \let\pgfplots@recordederrorbar=\pgfutil@empty + \fi + \ifpgfplots@stackedmode + \pgfplots@stacked@beginplot + \fi + % + %\let\pgfplots@coord@stream@recorded=\pgfutil@empty + % + }% + \let\pgfplots@coord@stream@coord@=\pgfplots@process@one@point + \def\pgfplots@coord@stream@end@{% + \ifpgfplots@errorbars@enabled + \pgfplots@streamerrorbarend + \fi + \ifpgfplots@coord@stream@isfirst + \pgfplots@warning{Empty plot silently dropped.}% + \else + \ifpgfplots@stackedmode + \pgfplots@stacked@endplot + \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@addplot@preoptionsTMP{/pgfplots/every axis plot,/pgfplots/every axis plot no \the\pgfplots@numplots/.try}% + \expandafter\pgfplots@rememberplotspec\expandafter{\pgfplots@addplot@preoptionsTMP,#1,/pgfplots/every axis plot post}% + % warning: rememberplotspec calls list macros which + % overwrite \t@pgfplots@toka + \t@pgfplots@toka=\expandafter{\pgfplots@addplot@preoptionsTMP,#1,/pgfplots/every axis plot post}% + \xdef\pgfplots@last@plot@style{\the\t@pgfplots@toka}% store it for \label commands. + % ATTENTION: do NOT call list macros from here on! + % + \ifpgfplots@datascaletrafo@initialised + \pgfplots@addplot@get@named@startendpoints@command\pgfplots@loc@TMPa + \t@pgfplots@tokc=\expandafter{\pgfplots@loc@TMPa}% + \else + \t@pgfplots@tokc={}% + \fi + \ifx\pgfplots@recordederrorbar\pgfutil@empty + \let\pgfplots@loc@TMPb=\pgfutil@empty% + \else + \t@pgfplots@tokb=\expandafter{\pgfplots@recordederrorbar}% + \def\pgfplots@loc@TMPb{% + \noexpand\pgfplots@errorbars@finishwithstyleoptions[current plot style]{\the\t@pgfplots@tokb}% + }% + \fi + % assembe a \pgfplots@addplot@enqueue@coords command ... + % BEGIN HERE ... + % vvvvvvvvvv + \xdef\pgfplots@glob@TMPa{% + \noexpand\pgfplots@addplot@enqueue@coords + {% precommand: + \noexpand\def\noexpand\plotnum{\the\pgfplots@numplots}% + \noexpand\pgfplots@initzerolevelhandler + \the\t@pgfplots@tokc% named start/end points (if already available) + \noexpand\pgfkeysdef{/tikz/current plot style}{\noexpand\pgfkeysalso{\the\t@pgfplots@toka}}% + \pgfplots@loc@TMPb% error bar commands + }% + {% draw command: + \noexpand\draw% + }% + }% + \pgfplotsapplistXXlet\pgfplots@coord@stream@recorded + \pgfplotsapplistXXclear + \t@pgfplots@tokc=\expandafter{\pgfplots@coord@stream@recorded}% + \t@pgfplots@tokb={#2;}% + \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPa}% + \xdef\pgfplots@glob@TMPa{% + \the\t@pgfplots@toka + {% coordinates which need to be processed in \endaxis: + plot coordinates {\the\t@pgfplots@tokc}\the\t@pgfplots@tokb + }% + {% postcommand + }% + }% + \pgfplots@glob@TMPa + %^^^^^^^^^^^^ ... END of \pgfplots@addplot@enqueue@coords HERE + \pgfplots@end@plot + \fi + }% +}% + +\def\pgfplots@end@plot{% + \global\advance\pgfplots@numplots by1\relax% + \ifx\pgfplots@execute@at@end@plot\pgfutil@empty + \else + \pgfplots@execute@at@end@plot + \fi + \global\let\pgfplots@glob@TMPa=\relax + \ifpgfplots@collect@firstplot@astick + \ifnum\pgfplots@numplots=1\relax + \t@pgfplots@toka=\expandafter{\pgfplots@firstplot@coords@x}% + \t@pgfplots@tokb=\expandafter{\pgfplots@firstplot@coords@y}% + \xdef\pgfplots@glob@TMPa{% + \noexpand\def\noexpand\pgfplots@firstplot@coords@x{\the\t@pgfplots@toka}% + \noexpand\def\noexpand\pgfplots@firstplot@coords@y{\the\t@pgfplots@tokb}% + }% + \fi + \fi + \endgroup + \pgfplots@glob@TMPa% 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{% + \pgfplotsapplistXnewempty\pgfplots@streamerrorbar@recordto@@ + }% + \def\pgfplots@streamerrorbarend{% + \pgfplotsapplistXlet#1=\pgfplots@streamerrorbar@recordto@@ + \pgfplotsapplistXnewempty\pgfplots@streamerrorbar@recordto@@% clear + }% + \def\pgfplots@streamerrorbarcoords##1##2{% + \pgfplotsapplistXpushback{\pgfplots@errorbar@draw{##1}{##2}}\to\pgfplots@streamerrorbar@recordto@@ + }% +} +\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: +% - the input coordinates have been parsed correctly (floating point +% format for linear axis, log applied for logarithmic ones) +% +% #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) ...}% + \ifpgfplots@autocomputeanylimits + \pgfplots@update@limits@for@one@point@ISCLIPPEDfalse + \ifpgfplots@autocompute@all@limits + \else + % check whether we need to clip limits: + \ifpgfplots@clip@limits + \ifpgfplots@autocompute@xmin + \else + \ifpgfplots@xislinear + \pgfmathfloatlessthan@{#1}{\pgfplots@xmin}% + \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 + \fi + \fi + \ifpgfplots@autocompute@xmax + \else + \ifpgfplots@xislinear + \pgfmathfloatlessthan@{\pgfplots@xmax}{#1}% + \ifpgfmathfloatcomparison + \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue + \fi + \else + \pgfmathlessthan@{\pgfplots@xmax}{#1}% + \ifx\pgfmathresult\pgfplots@math@ONE + \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue + \fi + \fi + \fi + \ifpgfplots@autocompute@ymin + \else + \ifpgfplots@yislinear + \pgfmathfloatlessthan@{#2}{\pgfplots@ymin}% + \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 + \fi + \fi + \ifpgfplots@autocompute@ymax + \else + \ifpgfplots@yislinear + \pgfmathfloatlessthan@{\pgfplots@ymax}{#2}% + \ifpgfmathfloatcomparison + \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue + \fi + \else + \pgfmathlessthan@{\pgfplots@ymax}{#2}% + \ifx\pgfmathresult\pgfplots@math@ONE + \pgfplots@update@limits@for@one@point@ISCLIPPEDtrue + \fi + \fi + \fi + \fi + \fi + % + % + % + % Update limits: + \ifpgfplots@update@limits@for@one@point@ISCLIPPED + \else + \ifpgfplots@autocompute@xmin + \ifpgfplots@xislinear + \pgfmathfloatmin@{\pgfplots@xmin}{#1}% + \global\let\pgfplots@xmin=\pgfmathresult + \else + \pgfmathmin@{\pgfplots@xmin}{#1}% + \global\let\pgfplots@xmin=\pgfmathresult + \fi + \fi + \ifpgfplots@autocompute@xmax + \ifpgfplots@xislinear + \pgfmathfloatmax@{\pgfplots@xmax}{#1}% + \global\let\pgfplots@xmax=\pgfmathresult + \else + \pgfmathmax@{\pgfplots@xmax}{#1}% + \global\let\pgfplots@xmax=\pgfmathresult + \fi + \fi + \ifpgfplots@autocompute@ymin + \ifpgfplots@yislinear + \pgfmathfloatmin@{\pgfplots@ymin}{#2}% + \global\let\pgfplots@ymin=\pgfmathresult + \else + \pgfmathmin@{\pgfplots@ymin}{#2}% + \global\let\pgfplots@ymin=\pgfmathresult + \fi + \fi + \ifpgfplots@autocompute@ymax + \ifpgfplots@yislinear + \pgfmathfloatmax@{\pgfplots@ymax}{#2}% + \global\let\pgfplots@ymax=\pgfmathresult + \else + \pgfmathmax@{\pgfplots@ymax}{#2}% + \global\let\pgfplots@ymax=\pgfmathresult + \fi + \fi + \fi + \fi + % + % Compute data range: + \ifpgfplots@autocompute@all@limits + \global\let\pgfplots@data@xmin=\pgfplots@xmin + \global\let\pgfplots@data@xmax=\pgfplots@xmax + \global\let\pgfplots@data@ymin=\pgfplots@ymin + \global\let\pgfplots@data@ymax=\pgfplots@ymax + \else + % Attention: it is only done for linear axis! + \ifpgfplots@xislinear + \pgfmathfloatmin@{\pgfplots@data@xmin}{#1}% + \global\let\pgfplots@data@xmin=\pgfmathresult + \pgfmathfloatmax@{\pgfplots@data@xmax}{#1}% + \global\let\pgfplots@data@xmax=\pgfmathresult + \fi + \ifpgfplots@yislinear + \pgfmathfloatmin@{\pgfplots@data@ymin}{#2}% + \global\let\pgfplots@data@ymin=\pgfmathresult + \pgfmathfloatmax@{\pgfplots@data@ymax}{#2}% + \global\let\pgfplots@data@ymax=\pgfmathresult + \fi + \fi +%\pgfplots@message{Updated limits: (\pgfplots@xmin,\pgfplots@ymin) rectangle (\pgfplots@xmax,\pgfplots@ymax).}% +%\tracingmacros=0\tracingcommands=0 +} +\let\pgfplots@update@limits@for@one@point@orig=\pgfplots@update@limits@for@one@point + +\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 + % + \ifpgfplots@xislinear + \ifx\pgfplots@current@point@x\pgfutil@empty + \else + \pgfmathfloatparsenumber{\pgfplots@current@point@x}% + \expandafter\pgfmathfloat@decompose@F\pgfmathresult\relax\c@pgf@counta + \ifnum\c@pgf@counta>2 + \let\pgfplots@current@point@x=\pgfutil@empty + \else + \let\pgfplots@current@point@x=\pgfmathresult + \fi + \fi + \fi + % + \ifpgfplots@yislinear + \ifx\pgfplots@current@point@y\pgfutil@empty + \else + \pgfmathfloatparsenumber{\pgfplots@current@point@y}% + \expandafter\pgfmathfloat@decompose@F\pgfmathresult\relax\c@pgf@counta + \ifnum\c@pgf@counta>2 + \let\pgfplots@current@point@y=\pgfutil@empty + \else + \let\pgfplots@current@point@y=\pgfmathresult + \fi + \fi + \fi + % + \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@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}% + \else + % the finishpoint routine will be invoked at + % \endaxis. + \fi + \fi + % update also axis / data limits: + \pgfplots@update@limits@for@one@point{\pgfplots@current@point@x}{\pgfplots@current@point@y}{}{}% + \ifpgfplots@errorbars@enabled + \pgfplots@process@errorbar@for{\pgfplots@current@point@x}{\pgfplots@current@point@y}{#3}{#4}{#1}{#2}% + \fi + % + \edef\pgfplots@loc@TMPa{(\pgfplots@current@point@x,\pgfplots@current@point@y)}% + \expandafter\pgfplotsapplistXXpushback\expandafter{\pgfplots@loc@TMPa}% + %\t@pgfplots@tokc=\expandafter{\pgfplots@coord@stream@recorded}% + %\edef\pgfplots@coord@stream@recorded{\the\t@pgfplots@tokc (\pgfplots@current@point@x,\pgfplots@current@point@y)}% + % + \ifpgfplots@collect@firstplot@astick + \ifnum\pgfplots@numplots=0 + \ifx\pgfplots@firstplot@coords@x\pgfutil@empty + \t@pgfplots@tokc=\expandafter{}% + \else + \t@pgfplots@tokc=\expandafter{\pgfplots@firstplot@coords@x,}% + \fi + \edef\pgfplots@firstplot@coords@x{\the\t@pgfplots@tokc\pgfplots@current@point@x}% + \ifx\pgfplots@firstplot@coords@y\pgfutil@empty + \t@pgfplots@tokc=\expandafter{}% + \else + \t@pgfplots@tokc=\expandafter{\pgfplots@firstplot@coords@y,}% + \fi + \edef\pgfplots@firstplot@coords@y{\the\t@pgfplots@tokc\pgfplots@current@point@y}% + \fi + \fi + \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 + \ifx\pgfplots@currentplot@firstcoord@x\pgfutil@empty + \else + \ifx\pgfplots@currentplot@firstcoord@y\pgfutil@empty + \else + \let\pgfplots@currentplot@firstcoord@x=\pgfplots@current@point@x + \let\pgfplots@currentplot@firstcoord@y=\pgfplots@current@point@y + \pgfplots@coord@stream@isfirstfalse + \fi + \fi + \fi + \ifx\pgfplots@current@point@x\pgfutil@empty + \else + \ifx\pgfplots@current@point@y\pgfutil@empty + \else + \let\pgfplots@currentplot@lastcoord@x=\pgfplots@current@point@x + \let\pgfplots@currentplot@lastcoord@y=\pgfplots@current@point@y + \fi + \fi +}% + +% 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 +}% + +% this is a convenience macro to save storage in the long coordinate +% lists. +\def\pgfplots@stream#1#2{\pgfplotstreampoint{\pgfqpoint{#1}{#2}}} + +\newif\ifpgfplots@record@marker@stream +% Takes a sequence of PREPARED coordinates which are given in floating +% point representation and applies the data scaling trafo (if +% necessary). +% +% Any coordinate will be plotted with the selected PGF plot handler. +% +% This stream is designed to be done at the end of an axis. +% See \pgfplots@coord@stream@finalize@storedcoords@START +% +% #1 : a macro which will be filled with a pgf plot stream for the +% marker points. +\def\pgfplots@coord@stream@INIT@finalize@storedcoords#1{% + % + % Init the plot handlers: + \pgfplots@getcurrent@plothandler\pgfplots@basiclevel@plothandler + \pgfplots@gettikzinternal@keyval{mark}{tikz@plot@mark}{}% + % + \ifx\tikz@plot@mark\pgfutil@empty + % mark=none : no need to waste time collecting marker + % positions. + \pgfplots@record@marker@streamfalse + \else + \ifx\pgfplots@basiclevel@plothandler\pgfplothandlerdiscard + \ifpgfplots@clip@marker@paths + % only marks: draw markers directly; no need for the + % two-pass-approach. + \let\pgfplots@basiclevel@plothandler=\relax + \pgfplots@install@plotmark@handler + \pgfplots@record@marker@streamfalse + \else + % collect mark positions... they will be drawn after + % the clipped axis range. Clipping will only be + % applied to their *positions*, not their paths. + \pgfplots@record@marker@streamtrue + \fi + \else + % ok, mark!=none and we also have a plot handler. + % So, collect mark positions! + \pgfplots@record@marker@streamtrue + \fi + \fi + \gdef#1{}% + % + % Now, set up coordinate streams. + \def\pgfplots@coord@stream@start@{% + \ifpgfplots@apply@datatrafo + \ifpgfplots@stackedmode + \pgfplots@stacked@beginplot + \fi + \fi + \pgfplots@basiclevel@plothandler + \pgfplotstreamstart + \let\pgfplots@data@scaletrafo@result=\pgfutil@empty + \ifpgfplots@record@marker@stream + \pgfplotsapplistXXnewempty + \pgfplotsapplistXXpushback{\pgfplotstreamstart}% + %\gdef#1{\pgfplotstreamstart}% + \fi + }% + \def\pgfplots@coord@stream@end@{% + \ifpgfplots@apply@datatrafo + \ifpgfplots@stackedmode + \pgfplots@stacked@endplot + \fi + \pgfplots@addplot@get@named@startendpoints@command\pgfplots@loc@TMPa + \pgfplots@loc@TMPa + \fi + \pgfplotstreamend + \ifpgfplots@record@marker@stream + \pgfplotsapplistXXpushback{\pgfplotstreamend}% + \pgfplotsapplistXXflushbuffers% + \global\let#1=\pgfplotsapplistXX + \pgfplotsapplistXXclear + %\expandafter\gdef\expandafter#1\expandafter{#1\pgfplotstreamend}% + \fi + }% + \ifpgfplots@apply@datatrafo + \def\pgfplots@coord@stream@coord@##1##2##3##4{% + \pgfplots@apply@data@scaletrafo@to@one@point{##1}{##2}{##3}{##4}% + \pgfplots@coord@stream@finalize@currentpt + }% + \else + \def\pgfplots@coord@stream@coord@##1##2##3##4{% + \def\pgfplots@current@point@x{##1}% + \def\pgfplots@current@point@y{##2}% + \pgfplots@coord@stream@finalize@currentpt + }% + \fi + % + \def\pgfplots@coord@stream@finalize@currentpt{% + \pgfqpointxy{\pgfplots@current@point@x}{\pgfplots@current@point@y}% + \ifpgfplots@record@marker@stream + \ifdim\pgf@x<\pgfplots@xcoordminTEX + \else + \ifdim\pgf@x>\pgfplots@xcoordmaxTEX + \else + \ifdim\pgf@y<\pgfplots@ycoordminTEX + \else + \ifdim\pgf@y>\pgfplots@ycoordmaxTEX + \else + \edef\pgfmathresult{\noexpand\pgfplots@stream{\the\pgf@x}{\the\pgf@y}}% + \expandafter\pgfplotsapplistXXpushback\expandafter{\pgfmathresult}% + \fi + \fi + \fi + \fi + \fi + \pgfplotstreampoint{}% it will simply take \pgf@x and \pgf@y! + }% +} +\def\pgfplots@addplot@get@named@startendpoints@command#1{% + \edef#1{% + \noexpand\pgfcoordinate{current plot begin}{\noexpand\pgfqpointxy{\pgfplots@currentplot@firstcoord@x}{\pgfplots@currentplot@firstcoord@y}}% + \noexpand\pgfcoordinate{current plot end}{\noexpand\pgfqpointxy{\pgfplots@currentplot@lastcoord@x}{\pgfplots@currentplot@lastcoord@y}}% + }% +}% + +% INPUT: +% either floating point or fixed point coordinates (depending on the +% state of the \ifpgfplots@apply@datatrafo boolean) +% +\long\def\pgfplots@coord@stream@finalize@storedcoords@START plot coordinates #1#2;\pgfplots@EOI{% + \pgfplots@assert@tikzinternal@exists{tikz@make@last@position}% + \pgfplots@stored@current@cmd[current plot style] + \pgfextra + \tikzset{every plot/.try}% + \pgfplots@coord@stream@INIT@finalize@storedcoords\pgfplots@recorded@marker@stream% + \pgfplots@coord@stream@foreach{#1}% + \tikz@make@last@position{\pgfplotlastpoint}% + \endpgfextra + #2; + \ifx\pgfplots@recorded@marker@stream\pgfutil@empty + \else + \ifpgfplots@clip@marker@paths + % Draw markers on top of the plot lines: + % + % FIXME: inefficient! Use \scope to set variables of 'current plot style' !? + \pgfplots@stored@current@cmd[current plot style] + \pgfextra + \pgfplots@install@plotmark@handler + \pgfplots@recorded@marker@stream + \endpgfextra + ; + \else + % sigh... ok, store the marker list (once more again). + % They need to be drawn after the clipped area. + \pgfplots@stored@REMEMBER@MARK@COMMAND + \fi + \fi + \gdef\pgfplots@recorded@marker@stream{}% clear +}% + +% This method MUST be called while \pgfplots@stored@plotlist is +% evaluated, that means +% - \pgfplots@stored@* commands need to be valid, +% - the precommand has already been invoked. +% - pgfplots@recorded@marker@stream exists +% - current plot style is valid +\def\pgfplots@stored@REMEMBER@MARK@COMMAND{% + \pgfkeysgetvalue{/tikz/current plot style/.@cmd}{\pgfplots@loc@TMPa}% + \t@pgfplots@toka=\expandafter{\pgfplots@loc@TMPa\pgfeov}% + \t@pgfplots@tokb=\expandafter{\pgfplots@stored@current@cmd[current plot style]}% + \t@pgfplots@tokc=\expandafter{\pgfplots@recorded@marker@stream}% + \edef\pgfplots@loc@TMPa{% + \noexpand\pgfkeysdef{/tikz/current plot style}{\the\t@pgfplots@toka}% + \the\t@pgfplots@tokb + \noexpand\pgfextra + \noexpand\pgfplots@install@plotmark@handler + \the\t@pgfplots@tokc + \noexpand\endpgfextra + ;}% + \expandafter\pgfplotslistpushbackglobal\expandafter{\pgfplots@loc@TMPa}\to\pgfplots@stored@markerlist +}% + +\def\pgfplots@install@plotmark@handler{% + \pgfplots@assert@tikzinternal@exists{tikz@options}% + % note: I can't check on tikz@transform because it can be + % '\relax'. + \pgfplots@gettikzinternal@keyval{mark indices}{tikz@mark@list}{}% + \pgfplots@gettikzinternal@keyval{mark}{tikz@plot@mark}{}% + % + % do not reset \tikz@options: draw color may be acquired + % from 'current plot style' + %\let\tikz@options=\pgfutil@empty% + \let\tikz@transform=\pgfutil@empty% + \tikzset{every plot/.try,every mark}% + \tikz@options + \ifx\tikz@mark@list\pgfutil@empty% + \pgfplothandlermark{\tikz@transform\pgfuseplotmark{\tikz@plot@mark}}% + \else + \pgfplothandlermarklisted{\tikz@transform\pgfuseplotmark{\tikz@plot@mark}}{\tikz@mark@list}% + \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{} + + +% #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 +% \t@pgfplots@tokc=\expandafter{\pgfplots@data@scaletrafo@result}% +% \edef\pgfplots@data@scaletrafo@result{\the\t@pgfplots@tokc(\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/.cd,#1,/pgfplots/every error bar]% it used the /pgfplots/.unknown + #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@loc@TMPa{{(\pgfplots@xarg,\pgfplots@yarg)}{(\pgfplots@error@xarg,\pgfplots@error@yarg)}}% + \def\pgfplots@loc@TMPb{\pgfkeysvalueof{/pgfplots/error bars/draw error bar/.@cmd}}% + \expandafter\pgfplots@loc@TMPb\pgfplots@loc@TMPa\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@loc@TMPa{0}% + \ifx\pgfplots@loc@TMPa\pgfplots@error@xarg + \let\pgfplots@error@xarg=\pgfutil@empty + \fi + \ifx\pgfplots@loc@TMPa\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{% + \csname ifpgfplots@#1islinear\endcsname + \edef\pgfplots@error@src{\csname pgfplots@#1arg\endcsname}% + \ifcase\csname pgfplots@errorbars@#1mode\endcsname + % fixed absolute error. + \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 + \let\pgfplots@error@coord=\pgfmathresult + \or% fixed relative error: + \pgfmathparse{(1#2\csname pgfplots@errorbars@#1rel\endcsname)}% + \let\pgfplots@error@coord=\pgfmathresult + \pgfmathfloatmultiplyfixed@{\pgfplots@error@src}{\pgfplots@error@coord}% + \let\pgfplots@error@coord=\pgfmathresult + \or% explicit absolute: + \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 + \ifnum#3=1 + \pgfmathfloatadd@{\pgfplots@error@src}{\pgfplots@error@coord}% + \else + \pgfmathfloatsubtract@{\pgfplots@error@src}{\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 + \pgfmathparse{(1#2\pgfplots@error@coord)}% + \let\pgfplots@error@coord=\pgfmathresult + \pgfmathfloatmultiplyfixed@{\pgfplots@error@src}{\pgfplots@error@coord}% + \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@loc@TMPa{#1}% + \def\pgfplots@loc@TMPb{x}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \pgfplots@update@limits@for@one@point{\pgfplots@error@coord}{\pgfplots@yarg}{}{}% + \edef\pgfplots@loc@TMPa{% + {(\pgfplots@xarg,\pgfplots@yarg)}% + {(\pgfplots@error@coord,\pgfplots@yarg)}% + }% + \else + \pgfplots@update@limits@for@one@point{\pgfplots@xarg}{\pgfplots@error@coord}{}{}% + \edef\pgfplots@loc@TMPa{% + {(\pgfplots@xarg,\pgfplots@yarg)}% + {(\pgfplots@xarg,\pgfplots@error@coord)}% + }% + \fi + \expandafter\pgfplots@streamerrorbarcoords\pgfplots@loc@TMPa + \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 + \pgfplotslistpushbackglobal{#1}{#2}{#3}{#4}\to\pgfplots@stored@plotlist + \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\pgfplotsset\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 + }{% + \pgfplots@command@legend@impl + }% +} + +\def\pgfplots@command@legend@impl#1{% + \pgfplots@assign@list\pgfplots@loc@TMPc{#1}% + \global\let\pgfplots@legend=\pgfplots@loc@TMPc +} + + +\def\pgfplots@addlegendentry{% + \pgfutil@ifnextchar[{% + \pgfplots@addlegendentry@opts + }{% + \pgfplots@addlegendentry@opts[]% + }% +} +\def\pgfplots@addlegendentry@opts[#1]#2{% + \pgfplotslistpushbackglobal[#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{% + \pgfplots@getcurrent@plothandler\pgfplots@basiclevel@plothandler + % this method assigns '\tikz@plot@handler'. + % That's ok and does not introduce incompatibilities. + \ifx\pgfplots@basiclevel@plothandler\pgfplothandlerconstantlineto + \let\tikz@plot@handler=\pgfplothandlerconstantlinetomarkright + \else + \ifx\pgfplots@basiclevel@plothandler\pgfplothandlerconstantlinetomarkright + \let\tikz@plot@handler=\pgfplothandlerconstantlineto + \fi + \fi +} + +\long\def\pgfplots@show@small@legendplots#1#2{ + \begingroup + \def\pgfplots@loc@TMPb{#1}% + \ifx\pgfplots@loc@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 + % No legend commands appeared in the document. So, + % consider the key: + \pgfkeysgetvalue{/pgfplots/legend entries}\pgfplots@legend + \expandafter\pgfplots@assign@list\expandafter\pgfplots@legend\expandafter{\pgfplots@legend}% + \pgfplotslistcheckempty\pgfplots@legend + \fi + \ifpgfplotslistempty + \else + % + % + \begingroup + % assemble a + % \matrix { + % small plot & legend1\\ + % small plot & legend2\\ + % ... + % }; + % command [and using the 'legend columns' option] + % + % \t@pgfplots@toka={ + % small plot & legend1\\ + % small plot & legend2\\ + % ... + % } + % ( I have allocated the token registers in my + % liststructure.sty) + % + % \global\def\pgfplots@glob@TMPa{ + % \matrix { + % \TOKL@TA + % }; + % } + % -> finally, \pgfplots@glob@TMPa will contain the complete command. + \t@pgfplots@toka={}% + \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 + \t@pgfplots@tokb=\expandafter{% + \expandafter\pgfplots@show@small@legendplots + \expandafter{\pgfplots@curlegend@opts}}% + \t@pgfplots@tokb=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\t@pgfplots@tokb\expandafter{\pgfplots@curplotlist}% + \pgfmatrixnextcell\node}% + \t@pgfplots@tokb=\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\t@pgfplots@tokb + \expandafter{\pgfplots@curlegend};}% + \or + % legend plot pos=right + \t@pgfplots@tokb=\expandafter{% + \expandafter\node + \expandafter{\pgfplots@curlegend};% + \pgfmatrixnextcell + \pgfplots@show@small@legendplots}% + \t@pgfplots@tokb=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\t@pgfplots@tokb\expandafter{\pgfplots@curlegend@opts}}% + \t@pgfplots@tokb=\expandafter\expandafter\expandafter{\expandafter\the\expandafter\t@pgfplots@tokb\expandafter{\pgfplots@curplotlist}}% + \or + % legend plot pos=none + \t@pgfplots@tokb=\expandafter{\expandafter\node\expandafter{\pgfplots@curlegend};}% + \fi + \ifnum\curcolumnNum=\maxcolumnCount + \t@pgfplots@tokb=\expandafter{\the\t@pgfplots@tokb\\}% + \else + \ifnum\pgfplots@numplots=0 + \t@pgfplots@tokb=\expandafter{\the\t@pgfplots@tokb\\}% + \else + \t@pgfplots@tokb=\expandafter{\the\t@pgfplots@tokb\pgfmatrixnextcell}% + \fi + \fi + \xdef\pgfplots@glob@TMPa{% + \the\t@pgfplots@toka + \the\t@pgfplots@tokb + }% + \endgroup + \ifnum\curcolumnNum=\maxcolumnCount + \curcolumnNum=0 + \fi + \expandafter\t@pgfplots@toka\expandafter{\pgfplots@glob@TMPa}% + \fi + \repeat + \t@pgfplots@tokb={\matrix[/pgfplots/every axis legend]}% + \xdef\pgfplots@glob@TMPa{% + \noexpand\def\noexpand\plotnum{0}% + \the\t@pgfplots@tokb {% + \the\t@pgfplots@toka + };% + }% + \endgroup + \let\pgfplots@already@computed@legend@node=\pgfplots@glob@TMPa + \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@glob@TMPb) + \ifpgfplots@checkuniform@isfirst + \global\pgfplots@checkuniform@isfirstfalse + \else + \pgfmathsubtract@\cur\pgfplots@glob@TMPb% + \pgfmathapproxequalto@\pgfmathresult{1.0}% + \ifpgfmathcomparison + \else + \global\pgfplots@isuniformtickfalse + \breakforeach + \fi + \fi + \global\let\pgfplots@glob@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. +% +% #1: a tick sequence (expanded) +% #2: a macro which will be filled with the tick distance. This is +% only valid if \pgfplots@isuniformticktrue. +\def\pgfplots@checkisuniformLINEARtick#1#2{% + \begingroup + \global\pgfplots@isuniformticktrue + \pgfplots@checkuniform@isfirsttrue + \global\let\pgfplots@glob@TMPb=\pgfutil@empty + \global\def\pgfplots@glob@TMPa{1}% + \foreach \x in {#1}{% + \ifx\pgfplots@glob@TMPb\pgfutil@empty + \else + \pgfmathsubtract@\x\pgfplots@glob@TMPb + \ifpgfplots@checkuniform@isfirst + % remember first distance h = x_1 - x_0 + \global\let\pgfplots@glob@TMPa=\pgfmathresult + \global\pgfplots@checkuniform@isfirstfalse + \else + % check whether x_i - x_{i-1} = h + \pgfmathapproxequalto@\pgfmathresult\pgfplots@glob@TMPa% + \ifpgfmathcomparison + \else + \global\pgfplots@isuniformtickfalse + \breakforeach + \fi + \fi + \fi + \global\let\pgfplots@glob@TMPb=\x% + }% + \endgroup + \let#2=\pgfplots@glob@TMPa +} + +\def\skipsuffixzero#1.#2|{ + {% + \def\pgfplots@loc@TMPa{#2}% + \def\pgfplots@loc@TMPb{0}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@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@loc@TMPb in {#1} {% + \pgfmathmultiply@\pgfplots@loc@TMPb\logten% + \ifx#2\pgfutil@empty + \xdef#2{\pgfmathresult}% + \else + \xdef#2{#2,\pgfmathresult}% + \fi + }% +} + +\def\pgfplots@enlarge@limit@ifconfigured#1{% + \pgfplots@enlargelimits@autofalse + \pgfplots@enlargelimitsfalse + \pgfplots@enlargelimits@rel@threshfalse + \pgfkeysgetvalue{/pgfplots/enlarge #1 limits}{\pgfplots@loc@TMPa}% + % + \def\pgfplots@loc@TMPb{true}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \pgfplots@enlargelimitstrue + \else + \def\pgfplots@loc@TMPb{false}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \else + \def\pgfplots@loc@TMPb{auto}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \pgfplots@enlargelimits@autotrue + \else + \begingroup + % try to read it as number: + \pgf@xa\pgfplots@loc@TMPa pt\relax + \endgroup + \pgfplots@enlargelimitstrue + \pgfplots@enlargelimits@rel@threshtrue + \fi + \fi + \fi + \expandafter\let\expandafter\ifpgfplots@autocompute@@@min\csname ifpgfplots@autocompute@#1min\endcsname + \expandafter\let\expandafter\ifpgfplots@autocompute@@@max\csname ifpgfplots@autocompute@#1max\endcsname + \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{#1}% + \else + \ifpgfplots@enlargelimits@auto + %\ifpgfplots@hide@x + % there is no axis, so skip this enlargement (unless + % the user explizitly requests it) + % WHY!? + %\else + % FIXME : this here should be user-configurable! + \ifpgfplots@autocompute@@@min + \pgfplots@enlarge@limit@for{#1}% + \else + \ifpgfplots@autocompute@@@max + \pgfplots@enlarge@limit@for{#1}% + \fi + \fi + %\fi + \fi + \fi +} + +\def\pgfplots@enlarge@limit@for#1{% + \begingroup + \expandafter\let\expandafter\pgfplots@@min\expandafter=\csname pgfplots@#1min\endcsname + \expandafter\let\expandafter\pgfplots@@max\expandafter=\csname pgfplots@#1max\endcsname + \expandafter\let\expandafter\ifpgfplots@autocompute@@@min\csname ifpgfplots@autocompute@#1min\endcsname + \expandafter\let\expandafter\ifpgfplots@autocompute@@@max\csname ifpgfplots@autocompute@#1max\endcsname + \ifpgfplots@enlargelimits@rel@thresh + \pgfkeysgetvalue{/pgfplots/enlarge #1 limits}{\enlargepercent}% + \else + \def\enlargepercent{0.1}% FIXME : pack 10% as default into option 'enlargelimits' or so + \fi + \pgfmathsubtract@\pgfplots@@max\pgfplots@@min% + \pgf@xa\pgfmathresult pt + \pgf@xb\enlargepercent\pgf@xa + \ifdim\pgf@xb>0.001pt + % the case with + % enlargeabsolute ~= 0 + % means that \pgfplots@@min ~= \pgfplots@@max. + % It is handled in another method. + \edef\enlargeabsolute{\pgf@sys@tonumber{\pgf@xb}}% + % + \ifpgfplots@enlargelimits@auto + \ifpgfplots@autocompute@@@min + \pgfmathsubtract@\pgfplots@@min\enlargeabsolute% + \let\pgfplots@@min=\pgfmathresult + \fi + \ifpgfplots@autocompute@@@max + \pgfmathadd@\pgfplots@@max\enlargeabsolute% + \let\pgfplots@@max=\pgfmathresult + \fi + \else + % compute xmin := xmin - enlargeabsolute + \pgfmathsubtract@\pgfplots@@min\enlargeabsolute% + \let\pgfplots@@min=\pgfmathresult + \pgfmathadd@\pgfplots@@max\enlargeabsolute% + \let\pgfplots@@max=\pgfmathresult + \fi + \fi + \xdef\pgfplots@glob@TMPa{\pgfplots@@min}% + \xdef\pgfplots@glob@TMPb{\pgfplots@@max}% + \endgroup + \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfplots@glob@TMPa + \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfplots@glob@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 + \desirednumticks=\axisdefaulttryminticks + \fi + \else + \expandafter\ifnum\pgfplots@default@try@minticks@log>\desirednumticks + \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@loc@TMPa{\csname pgfplots@#1tickten\endcsname}% + \expandafter\pgfplots@compute@tick@times@logten\pgfplots@loc@TMPa\to\pgfplots@glob@TMPa + \expandafter\let\csname pgfplots@#1tick\endcsname=\pgfplots@glob@TMPa + \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=\pgf@ya + \let\MIN=\pgf@yb + % 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 +%\message{Axis limit #1: [\the\MIN:\the\MAX], diff = \the\H.}% + \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}% + \let\Hmacrobaseten=\pgfmathresult + \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 + % Ok, now it can happen that only ONE tick label is placed in + % this range. + % That's useless, so check for it. + % + % That's the case if + % MIN < ORIGMIN && MAX < MIN+2 H + % MIN < ORIGMIN by construction (ok, MIN <= ORIGMIN by + % construction, but I don't care about this case). + % So: check only the second condition. + \pgfplots@tmpa=\MINH + \advance\pgfplots@tmpa by\H + \ifdim\MAX<\pgfplots@tmpa + \expandafter\aftergroup\csname pgfplots@determinedefaultvalues@#1isuniformfalse\endcsname + % ok, do something special. + % + % The idea is now to place ticks at + % 10^{i*h} with properly choosen 'h'. + % + % So: apply basically the SAME code as above for linear + % axis, just everything log 10! And keep in mind that all + % coordinates are actually given as natural logarithms. + \expandafter\MIN\csname pgfplots@#1min\endcsname pt + \H=\MAX + \advance\H by-\MIN + \H=\reciproclogten\H +%\message{Axis limit #1: [\the\MIN:\the\MAX], diff/log(10) = \the\H.}% + \c@pgf@counta=\desirednumticks\relax + \advance\c@pgf@counta by-1 + \ifnum\c@pgf@counta>2 + % subtract one more. This algorithm here produces more + % ticks than the normal one which is designed for 10^i + \advance\c@pgf@counta by-1 + \fi + \divide\H by\c@pgf@counta\relax +%\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}% + \pgfmathfloatparsenumber{\Hmacro}% + \expandafter\pgfmathfloat@decompose\pgfmathresult\relax\pgfmathfloat@a@S\H\pgfmathfloat@a@E + % Determine properly snapped 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 + \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\pgf@sys@tonumber{\H}}{\the\pgfmathfloat@a@E}% + \expandafter\pgfmathfloattofixed\expandafter{\pgfmathresult}% + \let\Hmacro=\pgfmathresult + \H=\Hmacro pt% + % Ok, our step size h for 10^{i*h} is ready! +%\message{determined step size 10^{\Hmacro}}% + % Now, we want to activate the Tick set {10^{i*H}, i in \Z} + % compute I such that + % 10^{min} = 10^{I * H + rest}; |rest| < H + % -> I = round(xmin/H) + % -> MIN = I * H + % BUT EVERYTHING to log(10) basis! + \MIN=\reciproclogten\MIN\relax + \pgfmathlog@invoke@expanded\pgfmathdivide@{% + {\pgf@sys@tonumber\MIN}% + {\Hmacro}% + }% + \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\relax + \multiply\MIN by\c@pgf@counta\relax + % + % convert back to basis 'e': + \MIN=\logten\MIN\relax + \H=\logten\H\relax + \MINH=\MIN\relax + \advance\MINH by\H\relax + \fi +%\pgfplots@message{final H=\the\H.}% + \xdef\pgfplots@glob@TMPa{\pgf@sys@tonumber{\MIN},\pgf@sys@tonumber{\MINH},...,\pgf@sys@tonumber{\MAX}}% + \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\H}}% + \aftergroup\pgfplots@determinedefaultvalues@needs@check@uniformtickfalse + \else + \expandafter\global\expandafter\let\expandafter\pgfplots@glob@TMPa\csname pgfplots@#1tick\endcsname + \gdef\pgfplots@glob@TMPb{}% will be computed later, in 'check uniform tick' + \aftergroup\pgfplots@determinedefaultvalues@needs@check@uniformticktrue + \fi + \endgroup + \expandafter\let\csname pgfplots@#1tick\endcsname=\pgfplots@glob@TMPa + \expandafter\let\csname pgfplots@tick@distance@#1\endcsname=\pgfplots@glob@TMPb +%\pgfplots@message{pgfplots.sty: #1tick set to \csname pgfplots@#1tick\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@loc@TMPb in {#1} {% + \pgfmathfloatparsenumber{\pgfplots@loc@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@loc@TMPb in {#1} {% + #2{\pgfplots@loc@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@loc@TMPa{\pgf@sys@tonumber{#1}}% + \pgfmathfloatparsenumber{\pgfplots@loc@TMPa}% + \expandafter\pgfmathfloat@decompose@E\pgfmathresult\relax#2 + \advance#2 by1\relax +} + +% 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\relax + \advance#2 by1\relax +} + +% 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@display@min@float\csname pgfplots@#1min\endcsname + \expandafter\let\expandafter\pgfplots@display@max@float\csname pgfplots@#1max\endcsname + \expandafter\let\expandafter\pgfplots@data@min@float\csname pgfplots@data@#1min\endcsname + \expandafter\let\expandafter\pgfplots@data@max@float\csname pgfplots@data@#1max\endcsname + \expandafter\let\expandafter\pgfplots@actual@trafo\csname pgfplots@datascaletrafo@#1\endcsname + \ifpgfplots@autocompute@all@limits + \else + \pgfmathfloatmax@{\pgfplots@display@max@float}{\pgfplots@data@max@float}% + \let\pgfplots@data@max@float=\pgfmathresult + \pgfmathfloatmin@{\pgfplots@display@min@float}{\pgfplots@data@min@float}% + \let\pgfplots@data@min@float=\pgfmathresult + \fi + % + % Step 1: compute 'm', the data order + \pgfplots@compute@number@order@for@trafo@isfloat + \pgfplots@data@min@float + \tocount\data@cur@order + % + \data@max@order=\data@cur@order + % + \pgfplots@compute@number@order@for@trafo@isfloat + \pgfplots@data@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@loc@TMPa{#1}% + \def\pgfplots@loc@TMPb{x}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \data@dimen=\pgfplots@width\relax + \else + \def\pgfplots@loc@TMPb{y}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \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@data@min@float}% + \let\pgfplots@min@fixed=\pgfmathresult + \ifpgfplots@loop@CONTINUE + \pgfplots@actual@trafo{\pgfplots@data@max@float}% + \let\pgfplots@max@fixed=\pgfmathresult + \expandafter\data@tmp\pgfplots@max@fixed pt +%\message{Current trafo EXPONENT for #1 direction: \the\data@EXPONENT; original #1 data limits: [\pgfplots@data@min@float:\pgfplots@data@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 + \pgfmathsubtract@{\pgfplots@max@fixed}{\pgfplots@min@fixed}% + \expandafter\data@dimen\pgfmathresult pt + \pgfplots@loop@CONTINUEfalse + \ifdim\data@tmp<1500pt% a multiplication with '10' results in max = 15000 which is the upper limit. + \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 + %-------------------------------------------------- + % \ifdim\data@dimen>1200pt% FIXME : is this here ok!? CHECK IT! + % \ifdim\data@dimen>7999pt + % \advance\data@EXPONENT by-2 + % \else + % \advance\data@EXPONENT by-1 + % \fi + % \pgfplots@loop@CONTINUEfalse + % \fi + %-------------------------------------------------- + \repeat + \xdef\pgfplots@glob@TMPa{\csname pgfplots@data@scale@trafo@EXPONENT@#1\endcsname}% + \xdef\pgfplots@glob@TMPb{\pgfplots@min@fixed}% + \endgroup +%\message{Initialising the data scale transformation in direction #1 to 10^\pgfplots@glob@TMPa*#1 - \pgfplots@glob@TMPb...}% + % COMPLETE INITIALISATION: + \ifpgfplots@disabledatascaling + % this here is a waste of time, I know it. One could really + % safe a lot of CPU time when disabledatascaling is enabled... + % but it requires so much extra cases; I really don't want + % that! + \gdef\pgfplots@glob@TMPa{0}% + \gdef\pgfplots@glob@TMPb{0}% + \fi + \expandafter\let\csname pgfplots@data@scale@trafo@EXPONENT@#1\endcsname\pgfplots@glob@TMPa + \expandafter\let\csname pgfplots@data@scale@trafo@SHIFT@#1\endcsname\pgfplots@glob@TMPb% + % + % ... and apply transformation to any user input + % + % Transform axis limits: +%\message{#1- display 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- display limits after data transformation: [\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname]}% + % + % Convert any user-specified ticks: + \edef\pgfplots@loc@TMPa{\csname pgfplots@#1tick\endcsname}% + % this here should also work with 'xtick=\pgfutil@empty', the "No tick" command. + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \t@pgfplots@tokc=\expandafter{\csname pgfplots@datascaletrafo@#1\endcsname}% + \def\pgfplots@loc@TMPb{data}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@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@loc@TMPa\csname pgfplots@firstplot@coords@#1\endcsname + \t@pgfplots@toka=\expandafter{\pgfplots@loc@TMPa}% + \edef\pgfplots@loc@TMPa{{\the\t@pgfplots@toka}\the\t@pgfplots@tokc}% + \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks@isfloat\pgfplots@loc@TMPa\to\pgfplots@loc@TMPc + \else + \t@pgfplots@toka=\expandafter{\pgfplots@loc@TMPa}% +%\message{Converting #1tick='\csname pgfplots@#1tick\endcsname'}% + \edef\pgfplots@loc@TMPa{{\the\t@pgfplots@toka}\the\t@pgfplots@tokc}% + \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks\pgfplots@loc@TMPa\to\pgfplots@loc@TMPc + \fi + \expandafter\let\csname pgfplots@#1tick\endcsname=\pgfplots@loc@TMPc + \fi + % + % Convert any extra-ticks, see above. + \edef\pgfplots@loc@TMPa{\csname pgfplots@extra@#1tick\endcsname}% + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \t@pgfplots@tokc=\expandafter{\csname pgfplots@datascaletrafo@#1\endcsname}% + \edef\pgfplots@loc@TMPa{{\csname pgfplots@extra@#1tick\endcsname}\the\t@pgfplots@tokc}% + \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks\pgfplots@loc@TMPa\to\pgfplots@loc@TMPc + \expandafter\let\csname pgfplots@extra@#1tick\endcsname=\pgfplots@loc@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 +\newif\ifpgfplots@limits@are@computed + +\def\pgfplots@handle@invalid@range{% + % COMPLETELY EMPTY AXIS: + \pgfplots@warning{You have a plot with empty range. Replacing it with default and clearing plots.}% + \ifpgfplots@xislinear + \pgfmathfloatcreate{0}{0.0}{0}% + \global\let\pgfplots@xmin=\pgfmathresult + \pgfmathfloatcreate{1}{1.0}{0}% + \global\let\pgfplots@xmax=\pgfmathresult + \global\let\pgfplots@data@xmin=\pgfplots@xmin + \global\let\pgfplots@data@xmax=\pgfplots@xmax + \else + \gdef\pgfplots@xmin{0}% + \gdef\pgfplots@xmax{1}% + \fi + \ifpgfplots@yislinear + \pgfmathfloatcreate{0}{0.0}{0}% + \global\let\pgfplots@ymin=\pgfmathresult + \pgfmathfloatcreate{1}{1.0}{0}% + \global\let\pgfplots@ymax=\pgfmathresult + \global\let\pgfplots@data@ymin=\pgfplots@ymin + \global\let\pgfplots@data@ymax=\pgfplots@ymax + \else + \gdef\pgfplots@ymin{0}% + \gdef\pgfplots@ymax{1}% + \fi + \def\pgfplots@xtick{}% + \def\pgfplots@ytick{}% + \def\pgfplots@extra@xtick{}% + \def\pgfplots@extra@ytick{}% + \def\pgfplots@xtickten{}% + \def\pgfplots@ytickten{}% + % clear all plots! + \pgfplots@init@cleared@structures +} +\def\pgfplots@check@invalid@range{% + \pgfplots@limits@are@computedtrue + \ifx\pgfplots@xmin\pgfplots@invalidrange@xmin + \pgfplots@limits@are@computedfalse + \fi + \ifx\pgfplots@xmin\pgfplots@invalidrange@xmax + \pgfplots@limits@are@computedfalse + \fi + \ifx\pgfplots@ymin\pgfplots@invalidrange@ymin + \pgfplots@limits@are@computedfalse + \fi + \ifx\pgfplots@ymin\pgfplots@invalidrange@ymax + \pgfplots@limits@are@computedfalse + \fi + \ifpgfplots@limits@are@computed + \ifx\pgfplots@data@xmin\pgfplots@invalidrange@xmin + \global\let\pgfplots@data@xmin=\pgfplots@xmin + \fi + \ifx\pgfplots@data@xmin\pgfplots@invalidrange@xmax + \global\let\pgfplots@data@xmax=\pgfplots@xmax + \fi + \ifx\pgfplots@data@ymin\pgfplots@invalidrange@ymin + \global\let\pgfplots@data@ymin=\pgfplots@ymin + \fi + \ifx\pgfplots@data@ymin\pgfplots@invalidrange@ymax + \global\let\pgfplots@data@ymax=\pgfplots@ymax + \fi + \ifpgfplots@clip@limits + \else + % there is a rare change that min > max. + % Handle that ... + \pgfmathfloatmin@{\pgfplots@xmin}{\pgfplots@xmax}% + \global\let\pgfplots@xmin=\pgfmathresult + \pgfmathfloatmax@{\pgfplots@xmin}{\pgfplots@xmax}% + \global\let\pgfplots@xmax=\pgfmathresult + % + \pgfmathfloatmin@{\pgfplots@ymin}{\pgfplots@ymax}% + \global\let\pgfplots@ymin=\pgfmathresult + \pgfmathfloatmax@{\pgfplots@ymin}{\pgfplots@ymax}% + \global\let\pgfplots@ymax=\pgfmathresult + \fi + \else + \pgfplots@handle@invalid@range + \fi +}% + + +\def\pgfplots@determinedefaultvalues{% + \pgfplots@check@invalid@range + % + %-------------------------------------------------- + %FIXME + % \ifpgfplots@float@numerics@mode@x + % \pgfmathfloatmin@{\pgfplots@xmin}{\pgfplots@xmax}% + % \let\pgfplots@xmin=\pgfmathresult + % \pgfmathfloatmax@{\pgfplots@xmin}{\pgfplots@xmax}% + % \let\pgfplots@xmax=\pgfmathresult + % \else + % \pgfmathmin@{\pgfplots@xmin}{\pgfplots@xmax}% + % \let\pgfplots@xmin=\pgfmathresult + % \pgfmathmax@{\pgfplots@xmin}{\pgfplots@xmax}% + % \let\pgfplots@xmax=\pgfmathresult + % \fi + % \ifpgfplots@float@numerics@mode@y + % \pgfmathfloatmin@{\pgfplots@ymin}{\pgfplots@ymax}% + % \let\pgfplots@ymin=\pgfmathresult + % \pgfmathfloatmax@{\pgfplots@ymin}{\pgfplots@ymax}% + % \let\pgfplots@ymax=\pgfmathresult + % \else + % \pgfmathmin@{\pgfplots@ymin}{\pgfplots@ymax}% + % \let\pgfplots@ymin=\pgfmathresult + % \pgfmathmax@{\pgfplots@ymin}{\pgfplots@ymax}% + % \let\pgfplots@ymax=\pgfmathresult + % \fi + %-------------------------------------------------- +%\message{x = [\pgfplots@xmin:\pgfplots@xmax] y = [\pgfplots@ymin:\pgfplots@ymax]}% + % + % + \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@loc@TMPb{data}% + \ifx\pgfplots@xtick\pgfplots@loc@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@loc@TMPb{data}% + \ifx\pgfplots@ytick\pgfplots@loc@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. + \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@enlarge@limit@ifconfigured x + \pgfplots@enlarge@limit@ifconfigured y + % + \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}{\pgfplots@tick@distance@x}% + \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}{\pgfplots@tick@distance@y}% + \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@xislinear + \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 + \else + \global\let\pgfplots@ZERO@x=\pgfplots@xmin% + \fi + % + \ifpgfplots@yislinear + \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 + \else + \global\let\pgfplots@ZERO@y=\pgfplots@ymin% + \fi + % + \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{% + \begingroup + \pgf@xa=\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)) + % + % \pgf@xa := X-c: + \ifpgfplots@scale@only@axis + \else + \advance\pgf@xa by-45pt% FIXME determine 'c' correctly! + \fi + \ifdim\pgf@xa<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.}% + \pgf@xa=0pt + \fi + % \pgf@xb := x*(xmax-xmin): + \pgf@xb=\pgfplots@xcoordmaxTEX + \advance\pgf@xb by-\pgfplots@xcoordminTEX + \pgfmathlog@invoke@expanded\pgfmathdivide@{% + {\pgf@sys@tonumber\pgf@xa}% + {\pgf@sys@tonumber\pgf@xb}% + }% +%\pgfplots@message{pgfplots.sty: Computing 'x' such that 'width = c + x*(xmax-xmin)'; +% c=estimated, +% width-c =\the\pgf@xa, +% x*(xmax[=\the\pgfplots@xcoordmaxTEX] - xmin[=\the\pgfplots@xcoordminTEX)]) = \the\pgf@xb +% -> x-scale =#1 }% + \pgfmath@smuggleone\pgfmathresult + \endgroup + \let#1=\pgfmathresult +} + +% The same as \pgfplots@initsizes@getXscale, just for the height. +\def\pgfplots@initsizes@getYscale\into#1{% + \begingroup + \expandafter\pgf@xa\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)) + % + % \pgf@xa := X-c: + \ifpgfplots@scale@only@axis + \else + \advance\pgf@xa by-45pt\relax% FIXME determine 'c' correctly! + \fi + \ifdim\pgf@xa<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.}% + \pgf@xa=0pt + \fi + % \pgf@xb := x*(xmax-xmin): + \pgf@xb=\pgfplots@ycoordmaxTEX + \advance\pgf@xb by-\pgfplots@ycoordminTEX + \pgfmathlog@invoke@expanded\pgfmathdivide@{% + {\pgf@sys@tonumber\pgf@xa}% + {\pgf@sys@tonumber\pgf@xb}% + }% +%\pgfplots@message{pgfplots.sty: Computing 'y' such that 'height = c + y*(ymax-ymin)'; +% height=\pgfplots@height, +% c=estimated, +% height-c =\the\pgf@xa, +% y*(ymax[=\the\pgfplots@ycoordmaxTEX] - ymin[=\the\pgfplots@ycoordminTEX)]) = \the\pgf@xb +% -> y-scale =#1 }% + \pgfmath@smuggleone\pgfmathresult + \endgroup + \let#1=\pgfmathresult +} + + +\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\pgfplots@@min\csname pgfplots@#1min\endcsname + \expandafter\let\expandafter\pgfplots@@max\csname pgfplots@#1max\endcsname + \let\min@d=\pgf@xa + \let\max@d=\pgf@xb + \let\diff=\pgf@xc + \expandafter\min@d\pgfplots@@min pt + \expandafter\max@d\pgfplots@@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.0001pt + \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.0001pt + \pgfplots@avoid@emptyrange@@range@is@approx@equaltrue + \fi + \fi + \ifpgfplots@avoid@emptyrange@@range@is@approx@equal + \pgfplots@warning{Axis range for axis #1 is approximately equal; enlargeing it.}% + % the case \pgfplots@@min ~= \pgfplots@@max + % + % enlarge \pgfplots@@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 + \expandafter\let\expandafter\min@unscaled\csname pgfplots@#1min@unscaled@as@float\endcsname + \expandafter\let\expandafter\max@unscaled\csname pgfplots@#1max@unscaled@as@float\endcsname + % **sigh**. That's really work. + % + % This here happens ALWAYS if min == max for + % linear axis because the scaling + % transformation will result in T(min) = T(max) = 0 + % + % -> we need to enlarge limits in floating + % point arithmetics. + % + \pgfmathfloatcreate{0}{0.0}{0}% + \let\pgfplotsmath@zero=\pgfmathresult + % + \ifx\max@unscaled\pgfplotsmath@zero + % max == 0 + \pgfmathfloatcreate{1}{1.0}{0}% + \let\max@unscaled=\pgfmathresult + \pgfmathfloatcreate{2}{1.0}{0}% + \let\min@unscaled=\pgfmathresult + \else + % + \pgfmathfloatcreate{1}{1.2}{0}% + \let\pgfplotsmath@scalea=\pgfmathresult + \pgfmathfloatcreate{1}{8.0}{-1}% + \let\pgfplotsmath@scaleb=\pgfmathresult + % + \pgfmathfloatlessthan@{\pgfplotsmath@zero}{\max@unscaled}% + \ifpgfmathfloatcomparison + % 0 < max + \pgfmathfloatmultiply@{\max@unscaled}{\pgfplotsmath@scalea}% + \let\max@unscaled=\pgfmathresult + \pgfmathfloatmultiply@{\min@unscaled}{\pgfplotsmath@scaleb}% + \let\min@unscaled=\pgfmathresult + \else + \pgfmathfloatmultiply@{\max@unscaled}{\pgfplotsmath@scaleb}% + \let\max@unscaled=\pgfmathresult + \pgfmathfloatmultiply@{\min@unscaled}{\pgfplotsmath@scalea}% + \let\min@unscaled=\pgfmathresult + \fi + \fi + \csname pgfplots@datascaletrafo@#1\endcsname{\min@unscaled}% + \let\pgfplots@@min=\pgfmathresult + \csname pgfplots@datascaletrafo@#1\endcsname{\max@unscaled}% + \let\pgfplots@@max=\pgfmathresult + \min@d=\pgfplots@@min pt + \max@d=\pgfplots@@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@glob@TMPa{\pgf@sys@tonumber{\min@d}}% + \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\max@d}}% +%\pgfplots@message{ -> #1 = \pgfplots@glob@TMPa : \pgfplots@glob@TMPb;}% + \else + \global\let\pgfplots@glob@TMPa=\pgfplots@@min% + \global\let\pgfplots@glob@TMPb=\pgfplots@@max% + \fi + \endgroup + \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfplots@glob@TMPa + \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfplots@glob@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. + % + % + \pgfqpointxy{\pgfplots@xmin}{\pgfplots@ymin}% + \pgfplots@xcoordminTEX=\pgf@x + \pgfplots@ycoordminTEX=\pgf@y + \pgfqpointxy{\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}% + \edef\pgfplots@tmpscale@x{\the\pgf@x}% + \edef\pgfplots@tmpscale@y{\the\pgf@y}% + \ifx\pgfplots@x\pgfutil@empty + \pgfsetxvec{\pgfqpoint{\pgfplots@tmpscale@x}{0pt}}% + \else + \pgfsetxvec{\pgfpoint{\pgfplots@x}{0pt}}% + \fi + \ifx\pgfplots@y\pgfutil@empty + \pgfsetyvec{\pgfqpoint{0pt}{\pgfplots@tmpscale@y}}% + \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. + % + \pgfqpointxy{\pgfplots@xmin}{\pgfplots@ymin}% + \pgfplots@xcoordminTEX=\pgf@x + \pgfplots@ycoordminTEX=\pgf@y + \pgfqpointxy{\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 here is a low-weight node. It can ONLY be used during axis +% descriptions and is completely useless otherwise. +% +% See pgfplots@low@level@shape below. +\pgfdeclareshape{pgfplots@low@level@shape@INNER}{% + \nodeparts{image}% + \anchor{image}{% + \pgf@x=0pt + \pgf@y=0pt + }% + % + % + \anchor{center}{\pgfqpointxy{0.5}{0.5}}% + \anchor{north}{\pgfqpointxy{0.5}{1}}% + \anchor{north east}{\pgfqpointxy{1}{1}}% + \anchor{east}{\pgfqpointxy{1}{0.5}} + \anchor{south east}{\pgfqpointxy{1}{0}}% + \anchor{south}{\pgfqpointxy{0.5}{0}}% + \anchor{south west}{\pgfqpointxy{0}{0}}% + \anchor{west}{\pgfqpointxy{0}{0.5}}% + \anchor{north west}{\pgfqpointxy{0}{1}}% + %% + \anchor{origin}{\pgfqpoint{\pgfplots@ZERO@x\relax}{\pgfplots@ZERO@y\relax}}% + \anchor{above origin}{\pgfqpoint{\pgfplots@ZERO@x\relax}{\pgfplots@ycoordmaxTEX}}% + \anchor{left of origin}{\pgfqpoint{\pgfplots@xcoordminTEX}{\pgfplots@ZERO@y\relax}}% + \anchor{right of origin}{\pgfqpoint{\pgfplots@xcoordmaxTEX}{\pgfplots@ZERO@y\relax}}% + \anchor{below origin}{\pgfqpoint{\pgfplots@ZERO@x\relax}{\pgfplots@ycoordminTEX}}% + %% + %% + %% + %% + \anchorborder{}% + \backgroundpath{}%\pgfpathrectangle{\pgfpointorigin}{\upperrightinnercorner}}% + \foregroundpath{}% + \behindbackgroundpath{}% + \beforebackgroundpath{}% + \behindforegroundpath{}% + \beforeforegroundpath{}% +} + +% 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{% + \pgfqpoint{\pgfplots@savedanchor@inner@lowerleft@x\relax}{\pgfplots@savedanchor@inner@lowerleft@y\relax}% + }% + \savedanchor\upperrightinnercorner{% + \pgfqpoint{\pgfplots@savedanchor@inner@upperright@x\relax}{\pgfplots@savedanchor@inner@upperright@y\relax}% + }% + \savedanchor\origin{% + \pgfqpoint{\pgfplots@ZERO@x\relax}{\pgfplots@ZERO@y\relax}% + }% + % + \nodeparts{image}% + \anchor{image}{% + \pgf@x=0pt + \pgf@y=0pt + }% + % + % + \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{origin}{% + \origin + }% + \anchor{above origin}{% + \origin + \pgf@xa=\pgf@x + \upperrightinnercorner + \pgf@x=\pgf@xa + }% + \anchor{left of origin}{% + \origin + \pgf@xa=\pgf@y + \lowerleftinnercorner + \pgf@y=\pgf@xa + }% + \anchor{right of origin}{% + \origin + \pgf@xa=\pgf@y + \upperrightinnercorner + \pgf@y=\pgf@xa + }% + \anchor{below origin}{% + \origin + \pgf@xa=\pgf@x + \lowerleftinnercorner + \pgf@x=\pgf@xa + }% + % + %% + % + \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{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@draw@axis{% + \ifpgfplots@hide@x\else + % compute tick position lists + % \pgfplots@prepared@tick@positions@minor@x + % and + % \pgfplots@prepared@tick@positions@major@x + \expandafter\pgfplots@prepare@ticks@for\expandafter{\pgfplots@xtick}{x}{0}% + \pgfplots@drawgridlines@for{x}{0}% + \fi + \ifpgfplots@hide@y\else + \expandafter\pgfplots@prepare@ticks@for\expandafter{\pgfplots@ytick}{y}{1}% + \pgfplots@drawgridlines@for{y}{1}% + \fi + % + \ifpgfplots@hide@x\else + \pgfplots@drawticklines@for{x}{0}% + \fi + \ifpgfplots@hide@y\else + \pgfplots@drawticklines@for{y}{1}% + \fi + % + \pgfplots@drawaxis@lines + % + \ifpgfplots@hide@x\else + \pgfplots@drawticklabels@for{x}{0}% + \fi + \ifpgfplots@hide@y\else + \pgfplots@drawticklabels@for{y}{1}% + \fi + % + \ifpgfplots@hide@x\else + \ifx\pgfplots@extra@xtick\pgfutil@empty + \else + \expandafter\pgfplots@draw@extra@ticks@for\expandafter x\expandafter0\expandafter{\pgfplots@extra@xtick}% + \fi + \fi + \ifpgfplots@hide@y\else + \ifx\pgfplots@extra@ytick\pgfutil@empty + \else + \expandafter\pgfplots@draw@extra@ticks@for\expandafter y\expandafter1\expandafter{\pgfplots@extra@ytick}% + \fi + \fi +}% + +\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@axis@on@top + \else + \pgfplots@draw@axis + \fi + \clip + (\pgfplots@xcoordminTEX, \pgfplots@ycoordminTEX) + rectangle (\pgfplots@xcoordmaxTEX, \pgfplots@ycoordmaxTEX); +} + + +\def\pgfplots@END@init@and@draw@axis{% + \endscope% + % + \ifpgfplots@axis@on@top + \pgfplots@draw@axis + \else + \fi + % + % whats the better sequence for \ifpgfplots@axis@on@top and \ifpgfplots@clip@marker@paths !? + % This here looks better, I think... markers should not be obscured by descriptions. + \ifpgfplots@clip@marker@paths + \else + \pgfplotslistforeach\pgfplots@stored@markerlist\as\pgfplots@loc@TMPa{% + \pgfplots@loc@TMPa + }% + \global\pgfplotslistnewempty\pgfplots@stored@markerlist% clear. + \fi + % + \begingroup + \pgfkeysvalueof{/pgfplots/after end axis/.@cmd}\pgfeov% + \endgroup + % +} + +% Writes output to \pgfmathresult +\def\pgfplots@filter@input@ticks@with@log#1{% + \let\pgfplots@glob@TMPa=\pgfutil@empty + \foreach \pgfplots@loc@TMPb in {#1} {% + \expandafter\pgfmathlog@\expandafter{\pgfplots@loc@TMPb}% + \ifx\pgfplots@glob@TMPa\pgfutil@empty + \xdef\pgfplots@glob@TMPa{\pgfmathresult}% + \else + \xdef\pgfplots@glob@TMPa{\pgfplots@glob@TMPa,\pgfmathresult}% + \fi + }% + \let\pgfmathresult=\pgfplots@glob@TMPa +} + +% Writes output to \pgfmathresult +% #1: the input ticks +% #2: the transformation command key as macro +\def\pgfplots@filter@input@ticks@with@highleveltrafo#1#2{% + \let\pgfplots@glob@TMPa=\pgfutil@empty + \foreach \pgfplots@loc@TMPb in {#1} {% + \expandafter#2\expandafter{\pgfplots@loc@TMPb}\pgfeov% + \ifx\pgfplots@glob@TMPa\pgfutil@empty + \xdef\pgfplots@glob@TMPa{\pgfmathresult}% + \else + \xdef\pgfplots@glob@TMPa{\pgfplots@glob@TMPa,\pgfmathresult}% + \fi + }% + \let\pgfmathresult=\pgfplots@glob@TMPa +} + +\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{% + \pgfkeysgetvalue{/pgfplots/#1 coord trafo/.@cmd}\pgfplots@loc@TMPc + \def\pgfmathresult{#2}% + \ifx\pgfplots@loc@TMPc\pgfplots@empty@command@key + \else + \expandafter\pgfplots@loc@TMPc\expandafter{\pgfmathresult}\pgfeov + \fi + \let\pgfplots@loc@TMPc=\pgfmathresult% FIXME: is that necessary? I doubt it... but just to make sure... + \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{\pgfplots@loc@TMPc}% + \fi + \else + \pgfmathlog@{\pgfplots@loc@TMPc}% + \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@glob@TMPa{\pgfplots@evaluate@tikz@coord@x}% + \xdef\pgfplots@glob@TMPb{\pgfmathresult}% + \endgroup + \pgfqpointxy{\pgfplots@glob@TMPa}{\pgfplots@glob@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. +% +% PRECONDITION: +% - The user input options have been set correctly, +% - the options have been set, but are not applied +% +% 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{% + \pgfkeysgetvalue{/pgfplots/#1 coord trafo/.@cmd}\pgfplots@loc@TMPc + \expandafter\let\csname pgfplots@highlevel@trafo@#1\endcsname=\pgfplots@loc@TMPc + \ifx\pgfplots@loc@TMPc\pgfplots@empty@command@key + % no high-level external coord trafos. + % Simply use identity: + \expandafter\def\csname pgfplots@prepare@#1coord\endcsname##1{% + \def\pgfmathresult{##1}% + }% + \else + % Apply external coordinate trafo to all input values: + \expandafter\edef\csname pgfplots@prepare@#1coord\endcsname##1{% + \noexpand\def\noexpand\pgfmathresult{##1}% + \expandafter\noexpand\csname pgfplots@highlevel@trafo@#1\endcsname{##1}\noexpand\pgfeov + }% + % + % The transformation is now \pgfplots@loc@TMPc + % + % any user-specified axis limits: + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1min\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfplots@loc@TMPc\expandafter{\pgfplots@loc@TMPa}\pgfeov% + \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult + \fi + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1max\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfplots@loc@TMPc\expandafter{\pgfplots@loc@TMPa}\pgfeov% + \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult + \fi + % + % any user specified axis ticks: + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1tick\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \def\pgfplots@loc@TMPb{data}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \else + \expandafter\pgfplots@filter@input@ticks@with@highleveltrafo\expandafter{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPc}% + \expandafter\edef\csname pgfplots@#1tick\endcsname{\pgfmathresult}% + \fi + \fi + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@extra@#1tick\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfplots@filter@input@ticks@with@highleveltrafo\expandafter{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPc}% + \expandafter\edef\csname pgfplots@extra@#1tick\endcsname{\pgfmathresult}% + \fi + % + \fi + % + \pgfkeysgetvalue{/pgfplots/#1filter}\pgfplots@loc@TMPa + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\let\csname pgfplots@#1filter@backwcompat\endcsname=\pgfplots@loc@TMPa + \t@pgfplots@tokc={/pgfplots/#1filter is deprecated. Please use /pgfplots/#1 filter/.code={\def\pgfmathresult{\#1}}}% + \pgfplots@warning{\the\t@pgfplots@tokc}% + \pgfkeys{/pgfplots/#1 filter/.code={\csname pgfplots@#1filter@backwcompat\endcsname{##1}\to\pgfmathresult}}% + \fi + \csname ifpgfplots@#1islinear\endcsname + \csname pgfplots@apply@datatrafo@#1true\endcsname + \pgfplots@apply@datatrafotrue + \ifpgfplots@apply@datatrafo + % Check for any existing axis limits: + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1min\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfmathfloatparsenumber\expandafter{\pgfplots@loc@TMPa}% + \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult + \fi + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1max\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfmathfloatparsenumber\expandafter{\pgfplots@loc@TMPa}% + \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult + \fi + \fi + \else + % This here could be done using a high level coord trafo as + % well! However, I don't want to risk accidentally overwritten + % keys, so I replicate it here. + \ifpgfplots@disablelogfilter + \else + % any user-specified axis limits: + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1min\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfmathlog@\expandafter{\pgfplots@loc@TMPa}% + \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult + \fi + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1max\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfmathlog@\expandafter{\pgfplots@loc@TMPa}% + \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult + \fi + % + % any user specified axis ticks: + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1tick\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \def\pgfplots@loc@TMPb{data}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \else + \expandafter\pgfplots@filter@input@ticks@with@log\expandafter{\pgfplots@loc@TMPa}% + \expandafter\edef\csname pgfplots@#1tick\endcsname{\pgfmathresult}% + \fi + \fi + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@extra@#1tick\endcsname + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfplots@filter@input@ticks@with@log\expandafter{\pgfplots@loc@TMPa}% + \expandafter\edef\csname pgfplots@extra@#1tick\endcsname{\pgfmathresult}% + \fi + % + % append logarithm to prepare coord. + % + \pgfkeysgetvalue{/pgfplots/#1 coord trafo/.@cmd}\pgfplots@loc@TMPc + \ifx\pgfplots@loc@TMPc\pgfplots@empty@command@key + \expandafter\def\csname pgfplots@prepare@#1coord\endcsname##1{% + \pgfmathlog@{##1}% + }% + \else + % This is a bit complicated... but it works. + \t@pgfplots@toka=\expandafter\expandafter\expandafter{\csname pgfplots@prepare@#1coord\endcsname{##1}\expandafter\pgfmathlog@\expandafter{\pgfmathresult}}% + \edef\pgfplots@loc@TMPa{\the\t@pgfplots@toka}% + \expandafter\def\expandafter\pgfplots@loc@TMPa\expandafter##\expandafter1\expandafter{\pgfplots@loc@TMPa}% + \expandafter\let\csname pgfplots@prepare@#1coord\endcsname=\pgfplots@loc@TMPa + \fi + \fi + \fi +} + +\def\pgfplots@create@axis@descriptions{% + \ifpgfplots@hide@x + \else + \pgfkeysgetvalue{/pgfplots/xlabel}{\pgfplots@label@}% + \ifx\pgfplots@label@\pgfutil@empty + \else + \pgfplots@show@label{x}{\pgfplots@label@}% + \fi + \fi + \ifpgfplots@hide@y + \else + \pgfkeysgetvalue{/pgfplots/ylabel}{\pgfplots@label@}% + \ifx\pgfplots@label@\pgfutil@empty + \else + \pgfplots@show@label{y}{\pgfplots@label@}% + \fi + \fi + % + \pgfkeysgetvalue{/pgfplots/title}\pgfplots@loc@TMPa + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \expandafter\pgfplots@show@title\expandafter{\pgfplots@loc@TMPa}% + \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@loc@TMPa{\pgfqkeysfiltered{/pgfplots}}% + \expandafter\pgfplots@loc@TMPa\expandafter{#1}% +} + +% #1: macro +% #2: style name +\long\def\pgfplots@append@keymacro@to@style#1#2{% + \t@pgfplots@toka={#2/.append style=}% + \t@pgfplots@tokb=\expandafter{#1}% + \edef\pgfplots@setkeys@TMP{\the\t@pgfplots@toka{\the\t@pgfplots@tokb}}% + \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{% + \t@pgfplots@toka={#2/.style=}% + \t@pgfplots@tokb=\expandafter{#1}% + \edef\pgfplots@setkeys@TMP{\the\t@pgfplots@toka{\the\t@pgfplots@tokb}}% + \expandafter\pgfplotsset\expandafter{\pgfplots@setkeys@TMP}% +%\pgfplots@message{tikzstyle{#2}=[#1]}% +} + +% backwards compatibility: +\let\prettyprintnumber=\pgfmathprintnumber% + +\def\pgfplots@set@options#1{% + \pgfutil@ifundefined{tikz@lastx}{% + % no warning. Its not that important anyway, I think. + \def\pgfplots@at{\pgfpointorigin}% + }{% + \def\pgfplots@at{\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% + }% + % + % 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@loc@TMPa +%\message{every axis is now '\meaning\pgfplots@loc@TMPa'}% + % + \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@loc@TMPa{data}% + \pgfplots@collect@firstplot@astickfalse + \ifx\pgfplots@xtick\pgfplots@loc@TMPa + \pgfplots@collect@firstplot@asticktrue + \fi + \ifx\pgfplots@ytick\pgfplots@loc@TMPa + \pgfplots@collect@firstplot@asticktrue + \fi + \ifpgfplots@collect@firstplot@astick + \let\pgfplots@firstplot@coords@x=\pgfutil@empty + \let\pgfplots@firstplot@coords@y=\pgfutil@empty + \fi + \pgfkeysdef{/pgfplots/.unknown}{% + \let\pgfplots@searchname=\pgfkeyscurrentname + \pgfkeysalso{/tikz/\pgfplots@searchname=##1}% + }% +} + +\def\pgfplots@install@abbrev@commands{ + \let\pgfplots@orig@path=\path + \let\pgfplots@orig@plot=\plot + % + \let\axispath=\pgfplots@path + \let\pgfplotsinterruptdatabb=\pgfplots@interruptdatabb + \let\endpgfplotsinterruptdatabb=\endpgfplots@interruptdatabb + % + \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 + }% + \def\axisdefaultticklabel{$\pgfmathprintnumber{\tick}$}% + \def\axisdefaultticklabellog{% + \pgfkeysgetvalue{/pgfplots/log number format code/.@cmd}\pgfplots@log@label@style + \expandafter\pgfplots@log@label@style\tick\pgfeov + }% + % + \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@autocomputeanylimits +\newif\ifpgfplots@autocompute@all@limits +\newif\ifpgfplots@autocompute@xmin +\newif\ifpgfplots@autocompute@xmax +\newif\ifpgfplots@autocompute@ymin +\newif\ifpgfplots@autocompute@ymax +\newif\ifpgfplots@apply@datatrafo@x +\newif\ifpgfplots@apply@datatrafo@y +\newif\ifpgfplots@apply@datatrafo +\newif\ifpgfplots@datascaletrafo@initialised +\newif\ifpgfplots@draw@at@end + +% 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@init@cleared@structures{% + \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 +} + +% The implementation for \label{foo} after \addplot. It allows to +% \ref{foo} (it inserts the 'legend image code'). +% +% I only need to overwrite '\label'; the rest is done by LaTeX. +% +% THIS IS INCOMPATIBLE WITH plain TeX and ConTeXt! Don't use it, it +% doesn't hurt. +\def\pgfplots@plot@label#1{% + \ifx\pgfplots@last@plot@style\pgfutil@empty + \pgfplots@error{Can't create \string\label{#1}: it needs to be called after \string\addplot.}% + \else + \begingroup + % I'd like to get all options which are INDEPENDENT of + % pgfplots. Idea: expand all /pgfplots-keys and collect + % everything which belongs NOT to /pgfplots. This is the + % completely expanded rest. At least, I hope so and it appears + % to work. + \pgfkeysinstallkeyfilter + {/pgf/key filters/and} + {{/pgf/key filters/is descendant of=/pgfplots}% + {/pgf/key filters/defined}}% + \def\pgfplots@label@tikzopts{}% + \pgfkeysinstallkeyfilterhandler{/pgf/key filter handlers/append filtered to}{\pgfplots@label@tikzopts}% + \def\pgfplots@loc@TMPa{\pgfqkeysfiltered{/tikz}}% + \expandafter\pgfplots@loc@TMPa\expandafter{\pgfplots@last@plot@style}% + % + \pgfkeysgetvalue{/pgfplots/every crossref picture/.@cmd}{\pgfplots@crossref@pic}% + \pgfkeysgetvalue{/pgfplots/legend image code/.@cmd}{\pgfplots@curlegendcode}% + \t@pgfplots@toka=\expandafter{\pgfplots@curlegendcode current plot style\pgfeov}% + \t@pgfplots@tokb=\expandafter{\pgfplots@label@tikzopts}% + \t@pgfplots@tokc=\expandafter{\pgfplots@crossref@pic\pgfeov}% + \edef\pgfplots@loc@TMPa{% + \noexpand\begingroup + \noexpand\pgfkeysdef{/tikz/current plot style}{\noexpand\pgfkeysalso{\the\t@pgfplots@tokb}}% + \noexpand\pgfkeysdef{/pgfplots/every crossref picture}{\the\t@pgfplots@tokc}% + \noexpand\tikz[/pgfplots/every crossref picture]{\the\t@pgfplots@toka}% + \noexpand\endgroup% + }% + \pgfplots@command@to@string{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPa}% + \global\let\pgfplots@glob@TMPb=\pgfplots@loc@TMPa + \endgroup + \let\@currentlabel=\pgfplots@glob@TMPb + \pgfplots@original@LaTeX@label{#1}% + \fi +}% + +\def\pgfplots@interruptdatabb{% + \def\pgfplots@update@limits@for@one@point##1##2##3##4{}% +}% +\def\endpgfplots@interruptdatabb{% + \let\pgfplots@update@limits@for@one@point=\pgfplots@update@limits@for@one@point@orig +}% + +\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: + % -------------------- + \pgfplots@init@cleared@structures + % + % -------------------- + % 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 + % + \ifpgfplots@xislinear + \pgfmathfloatcreate{1}{1.0}{2147483645}% + \let\pgfplots@invalidrange@xmin=\pgfmathresult + \pgfmathfloatcreate{2}{1.0}{2147483645}% + \let\pgfplots@invalidrange@xmax=\pgfmathresult + \else + \def\pgfplots@invalidrange@xmin{16300}% + \def\pgfplots@invalidrange@xmax{-16300}% + \fi + \ifpgfplots@yislinear + \pgfmathfloatcreate{1}{1.0}{2147483645}% + \let\pgfplots@invalidrange@ymin=\pgfmathresult + \pgfmathfloatcreate{2}{1.0}{2147483645}% + \let\pgfplots@invalidrange@ymax=\pgfmathresult + \else + \def\pgfplots@invalidrange@ymin{16300}% + \def\pgfplots@invalidrange@ymax{-16300}% + \fi + % + % These numbers will ONLY be filled for linear axis! + \global\let\pgfplots@data@xmin=\pgfplots@invalidrange@xmin + \global\let\pgfplots@data@xmax=\pgfplots@invalidrange@xmax + \global\let\pgfplots@data@ymin=\pgfplots@invalidrange@ymin + \global\let\pgfplots@data@ymax=\pgfplots@invalidrange@ymax + % + \pgfplots@autocompute@all@limitstrue + \ifx\pgfplots@xmin\pgfutil@empty + \pgfplots@autocompute@xmintrue + \global\let\pgfplots@xmin=\pgfplots@invalidrange@xmin + \pgfplots@autocomputeanylimitstrue + \else + \pgfplots@autocompute@all@limitsfalse + \fi + \ifx\pgfplots@xmax\pgfutil@empty + \pgfplots@autocompute@xmaxtrue + \global\let\pgfplots@xmax=\pgfplots@invalidrange@xmax + \pgfplots@autocomputeanylimitstrue + \else + \pgfplots@autocompute@all@limitsfalse + \fi + \ifx\pgfplots@ymin\pgfutil@empty + \pgfplots@autocompute@ymintrue + \global\let\pgfplots@ymin=\pgfplots@invalidrange@ymin + \pgfplots@autocomputeanylimitstrue + \else + \pgfplots@autocompute@all@limitsfalse + \fi + \ifx\pgfplots@ymax\pgfutil@empty + \pgfplots@autocompute@ymaxtrue + \global\let\pgfplots@ymax=\pgfplots@invalidrange@ymax + \pgfplots@autocomputeanylimitstrue + \else + \pgfplots@autocompute@all@limitsfalse + \fi + % + % autocomputelimits := at least one limit needs to be updated. + \ifpgfplots@autocomputeanylimits + \pgfplots@draw@at@endtrue + \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 + % + \pgfutil@ifundefined{label}{\relax}{% + \let\pgfplots@original@LaTeX@label=\label + \let\label=\pgfplots@plot@label + }% + \global\let\pgfplots@last@plot@style=\pgfutil@empty + % + % 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{% + \xdef\numplots{\the\pgfplots@numplots}% + \pgfkeysvalueof{/pgfplots/before end axis/.@cmd}\pgfeov% + % + % 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% ALWAYS TRUE - this is obsolete + \def\pgfplots@nextcommand{% + \pgfplots@BEGIN@init@and@draw@axis + \pgfplots@stacked@initialise + \global\pgfplotslistnewempty\pgfplots@stored@markerlist + \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@loc@TMPa{% + \expandafter\pgfplots@stored@plotlist@EXTRACTENTRY\pgfplots@loc@TMPa +%\message{Processing stored plot with precommand '\meaning\pgfplots@stored@current@precmd'; pgfplots@plotcmd '\meaning\pgfplots@stored@current@cmd' postcommand '\meaning\pgfplots@stored@current@postcmd'}% + % The precmd processed any error bars. + \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. + \pgfplots@stacked@draw@reversed@plot + \else + % modifies \pgfplots@stored@markerlist if necessary. + \expandafter\pgfplots@coord@stream@finalize@storedcoords@START\pgfplots@stored@current@data\pgfplots@EOI + \fi + \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 + % set coordinate system to (0,0) rectangle (1,1) for descriptions: + \pgftransformxshift{\pgfplots@xcoordminTEX}% + \pgftransformyshift{\pgfplots@ycoordminTEX}% + % + % create a 'current axis' node for anchor references. + \pgfmultipartnode{pgfplots@low@level@shape@INNER}{south west}{current axis}{\pgfusepath{discard}}% + % + \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}% + % + \pgf@xa=\pgfplots@ZERO@x + \advance\pgf@xa by-\pgf@picminx + \xdef\pgfplots@ZERO@x{\the\pgf@xa}% + % + \pgf@xa=\pgfplots@ZERO@y + \advance\pgf@xa by-\pgf@picminy + \xdef\pgfplots@ZERO@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 + \pgfnodealias{current axis}{\tikz@fig@name}% + % + \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{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 |