diff options
author | Karl Berry <karl@freefriends.org> | 2011-12-30 22:58:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-12-30 22:58:39 +0000 |
commit | 44ccd75065152cd73c512645bc4dc6d258fe62cb (patch) | |
tree | 39e9b861199f3172d9cff378a68f2c773248db87 /Master/texmf-dist/tex/generic | |
parent | b3370daebbffee05312803e74c40f6d0abbf08c4 (diff) |
pgfplots 1.5.1 (29dec11)
git-svn-id: svn://tug.org/texlive/trunk@24977 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
27 files changed, 1400 insertions, 186 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex index 32b0e5f32ee..dd7a735e252 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex @@ -110,6 +110,22 @@ }, /pgfplots/group/group name/.store in=\pgfplots@group@name, /pgfplots/group/empty plot/.style={/pgfplots/hide axis=true}, + /pgfplots/trim axis group left/.code={% + \pgfutil@ifundefined{pgfsettrimleft}{% + \pgfplots@error{Sorry, the 'trim axis group left' requires a more recent PGF version.}% + }{% + \pgfkeysalso{/tikz/trim left={(group c1r1.south west)}}% + }% + },% + /tikz/trim axis group left/.style={/pgfplots/trim axis group left}, + /pgfplots/trim axis group right/.code={% + \pgfutil@ifundefined{pgfsettrimleft}{% + \pgfplots@error{Sorry, the 'trim axis group right' requires a more recent PGF version.}% + }{% + \pgfkeysalso{/pgfplots/trim axis right}% + }% + },% + /tikz/trim axis group right/.style={/pgfplots/trim axis group right}, } \def\nextgroupplot{% diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex index 4076e37281c..f3e4674f9e6 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex @@ -1035,6 +1035,58 @@ \let\pgfplotspatchclass@rect@D@=\pgfplotspatchclass@rect@D% }% + +% An arbitrary poligy specified in the sequence +% D <-- C +% | ^ +% v | +% A --> B +% +\pgfkeyssetvalue{/pgfplots/vertex count}{0}% +\pgfplotsdeclarepatchclass{polygon}{% + new=\def\pgfplotspatchclass@poly@no{0}, + set next vertex={% + \pgfplotspatchclass@poly@checkcount + \expandafter\edef\csname pgfplotspatchclass@poly@\pgfplotspatchclass@poly@no\endcsname{#1}% + \pgfplotsutil@advancestringcounter\pgfplotspatchclass@poly@no + \ifnum\pgfplotspatchclass@poly@no=\pgfkeysvalueof{/pgfplots/vertex count} % + \def\pgfplotspatchclass@poly@no{0}% + \pgfplotspatchready% + \fi + }, + first vertex=\expandafter\expandafter\expandafter\pgfplotspatchvertex\csname pgfplotspatchclass@poly@0\endcsname\endvertex, + foreach vertex={% + \pgfplotspatchclass@poly@foreach@loop{0}{#1}% + }, + init pdf shading={% + \pgfplots@error{Sorry, patch type=polygon does not support shadings}% + }, + serialize except vertices=\let\pgfplotsretval\pgfutil@empty,% + deserialize except vertices=, + get pdf shading type=4, + get num vertices=\pgfkeysvalueof{/pgfplots/vertex count}, +}% +\def\pgfplotspatchclass@poly@checkcount{% + \ifnum\pgfkeysvalueof{/pgfplots/vertex count}>0 + \else + \pgfplots@error{Sorry, 'patch type=polygon' *requires* that 'vertex count=<num>' is set (note: it is allowed if multiple vertices have the same coordinates).}% + \fi +}% +\long\def\pgfplotspatchclass@poly@foreach@loop#1#2{% + \ifnum#1<\pgfkeysvalueof{/pgfplots/vertex count} % + \expandafter\expandafter\expandafter\pgfplotspatchvertex\csname pgfplotspatchclass@poly@#1\endcsname\endvertex #2% + \begingroup + \c@pgf@counta=#1 % + \advance\c@pgf@counta by1 % + \t@pgfplots@toka={#2}% + \xdef\pgfplots@glob@TMPc{\noexpand\pgfplotspatchclass@poly@foreach@loop{\the\c@pgf@counta}{\the\t@pgfplots@toka}}% + \endgroup + \else + \gdef\pgfplots@glob@TMPc{}% + \fi + \pgfplots@glob@TMPc +}% + \def\pgfplots@biquad@next@A{E} \def\pgfplots@biquad@next@B{F} \def\pgfplots@biquad@next@C{G} diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex index 7502dac1c36..24292d1354c 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex @@ -146,6 +146,7 @@ %\tracingmacros=0\tracingcommands=0 }% \def\pgfplotsaxisifcontainspoint@polar#1#2{% + \begingroup \pgfmath@basic@mod@{\pgfplots@current@point@x}{360}% \pgf@xa=\pgfmathresult pt % % @@ -154,6 +155,7 @@ % absolute value: \pgf@ya=-\pgf@ya \fi +%\message{ifcontainspoint(\the\pgf@xa,\pgfplots@current@point@y) limits = [\pgfplots@xmin@mod:\pgfplots@xmax@mod] x [\the\pgfplots@ymin@reg,\the\pgfplots@ymax@reg]^^J}% % % I assume that \pgfplots@[xyz]min@reg and min@reg are registers % containing the limits. @@ -188,7 +190,7 @@ \else \def\pgfplots@loc@TMPa{#2}% \fi - \pgfplots@loc@TMPa% + \expandafter\endgroup\pgfplots@loc@TMPa% } \def\pgfplots@check@invalid@range@polar{% @@ -485,10 +487,10 @@ \let\pgfplots@xmin@mod=\pgfmathresult \pgfmath@basic@mod@{\pgfplots@xmax}{360}% \let\pgfplots@xmax@mod=\pgfmathresult - \ifdim\pgfplots@xmax@mod pt<\pgfplots@xmin@mod pt - \def\b@pgfplots@polar@limit@around@zero{1}% - \else + \ifdim\pgfplots@xmax@mod pt>\pgfplots@xmin@mod pt \def\b@pgfplots@polar@limit@around@zero{0}% + \else + \def\b@pgfplots@polar@limit@around@zero{1}% \fi % \pgfplots@xmin@reg=\pgfplots@xmin pt % diff --git a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex index b5480f58b5b..1cde825708d 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex @@ -2540,6 +2540,7 @@ \fi \fi % + % The column NAMES are collected into this list: \global\pgfplotslistnewempty\pgfplotstable@colnames@glob % this thing counts output columns: \let\c@pgfplotstable@numoutcols=\c@pgf@countd @@ -2570,8 +2571,8 @@ \expandafter\pgfplotslist@assembleentry\expandafter{\pgfplots@colname}\into\t@pgfplots@tokc \def\pgfplotstableread@TMP{\expandafter\pgfplotsapplistXpushback\expandafter{\the\t@pgfplots@tokc}\to}% \expandafter\pgfplotstableread@TMP\csname pgfp@numtable@glob@col@\the\c@pgfplotstable@rowindex\endcsname - \advance\c@pgfplotstable@rowindex by1 \fi + \advance\c@pgfplotstable@rowindex by1 \fi % \pgfplotstableforeachcolumnelement\pgfplots@colname\of#3\as\pgfplots@cell{% @@ -2609,8 +2610,8 @@ \expandafter\pgfplotslist@assembleentry\expandafter{\pgfplots@cell}\into\t@pgfplots@tokc \def\pgfplotstableread@TMP{\expandafter\pgfplotsapplistXpushback\expandafter{\the\t@pgfplots@tokc}\to}% \expandafter\pgfplotstableread@TMP\csname pgfp@numtable@glob@col@\the\c@pgfplotstable@rowindex\endcsname - \advance\c@pgfplotstable@rowindex by1 \fi + \advance\c@pgfplotstable@rowindex by1 }% \def\pgfplotstable@isfirstcol{0}% }% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex index 42499218fef..74cb909c646 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex @@ -8,6 +8,14 @@ }{}% +\def\pgfmathfloatrounddisplaystyle@shared@impl@WRONG#1#2{% + {\toks0={#1}% + \toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}% + \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }% + }% + \let\pgfmathresult=\pgfmathfloat@glob@TMP +}% + % check whether we need to load supplementary code. % The development of pgfplots and pgf is intermingled, so pgfplots % always uses up-to-date pgf CVS versions - the relevant complements between @@ -17,7 +25,7 @@ % #2: for normal processing. \def\pgfplots@ifneedspgfcompabitibilitycode#1#2{% %\pgfkeysifdefined{/pgf/number format/sci precision/.@cmd}{#2}{#1}% - \pgfutil@ifundefined{pgfmath@tonumber@notrailingzero}{#1}{#2}% + \pgfutil@ifundefined{pgfplothandlerjumpmarkmid}{#1}{#2}% }% \pgfplots@ifneedspgfcompabitibilitycode diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex index dad89e7c7e1..64570e7fdc3 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex @@ -260,8 +260,10 @@ \tikzoption{const plot}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlineto} \tikzoption{const plot mark left}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlineto} \tikzoption{const plot mark right}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlinetomarkright} +\tikzoption{const plot mark mid}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlinetomarkmid} \tikzoption{jump mark right}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkright} \tikzoption{jump mark left}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkleft} +\tikzoption{jump mark mid}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkmid} \def\tikz@plot@samples{25} \def\tikz@plot@domain{-5:5} diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex index 5b9be1a3087..ae77a8e84fc 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex index 59688c15a67..02fe32acd2b 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% @@ -306,7 +306,30 @@ \expandafter\pgfkeys@normal% \fi% } -\long\def\pgfkeys@normal#1,{% +\newif\ifpgfkeys@syntax@handlers +\def\pgfkeys@normal{% + \ifpgfkeys@syntax@handlers% + \expandafter\pgfkeys@syntax@handlers% + \else% + \expandafter\pgfkeys@@normal% + \fi% +} +\def\pgfkeys@syntax@handlers{\pgfutil@ifnextchar\relax\pgfkeys@syntax@@handlers\pgfkeys@syntax@@handlers}%get rid of spaces +\def\pgfkeys@syntax@@handlers{\futurelet\pgfkeys@first@char\pgfkeys@syntax@handlers@test} +\def\pgfkeys@syntax@handlers@test{% + \pgfkeysgetvalue{/handlers/first char syntax/\meaning\pgfkeys@first@char}\pgfkeys@the@handler% + \ifx\pgfkeys@the@handler\relax% + \expandafter\pgfkeys@@normal% + \else% + \expandafter\pgfkeys@use@handler% + \fi% +} +\long\def\pgfkeys@use@handler#1,{% + \pgfkeys@the@handler{#1}% + \pgfkeys@parse% +} + +\long\def\pgfkeys@@normal#1,{% \pgfkeys@unpack#1=\pgfkeysnovalue=\pgfkeys@stop% \pgfkeys@parse% } @@ -849,6 +872,13 @@ \def\pgf@keys@do@list@item#1#2{\pgfkeysalso{#1={#2}}\pgf@keys@do@list{#1}} +% Forwarding + +\pgfkeys{/handlers/.forward to/.code=% + \pgfkeysifdefined{\pgfkeyscurrentpath/.@cmd}{}{\pgfkeysdef{\pgfkeyscurrentpath}{}} + \pgfkeys{\pgfkeyscurrentpath/.add code={}{\pgfkeys{#1={##1}}}} +} + % Inspection handlers @@ -856,6 +886,9 @@ \pgfkeys{/handlers/.show code/.code=\pgfkeysgetvalue{\pgfkeyscurrentpath/.@cmd}{\pgfkeysshower}\show\pgfkeysshower} % inspect the body of the command +% First char syntax handlers +\pgfkeys{/handlers/first char syntax/.is if=pgfkeys@syntax@handlers} + % Path handling % Prepares the .unknown handler used by '.search also'. diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex index 0094344d89b..5d9ad0a5504 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex index c08f7dee2fe..5183f85fc8e 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% @@ -177,11 +177,26 @@ \expandafter\let\expandafter#1\csname pgfmathfloat@backup@\string#1\endcsname% }% } +\def\pgfmathfloat@prepareuninstallcmd@csname#1{% + % and store backup information (globally - I don't want to do that + % all the time when the FPU is used!): + {% + \globaldefs=1 + \pgfutil@namelet{pgfmathfloat@backup@#1}{#1}% + \expandafter\gdef\expandafter\pgfmathfloat@uninstall\expandafter{\pgfmathfloat@uninstall + \pgfutil@namelet{#1}{pgfmathfloat@backup@#1}% + }% + }% +} \def\pgfmathfloat@install#1=#2{% \pgfmathfloat@prepareuninstallcmd{#1}% \let#1=#2% } +\def\pgfmathfloat@install@csname#1#2{% + \pgfmathfloat@prepareuninstallcmd@csname{#1}% + \pgfutil@namelet{#1}{#2}% +} \def\pgfmathfloat@install@unimplemented#1{% \expandafter\pgfmathfloat@prepareuninstallcmd\csname pgfmath@#1@\endcsname% \expandafter\def\csname pgfmath#1@\endcsname##1{\pgfmathfloat@notimplemented{#1}}% @@ -236,15 +251,24 @@ \pgfmathfloat@install\pgfmathcosec@=\pgfmathfloatcosec@% \pgfmathfloat@install\pgfmathexp@=\pgfmathfloatexp@% \pgfmathfloat@install\pgfmathln@=\pgfmathfloatln@% + \pgfmathfloat@install@csname{pgfmathlog10@}{pgfmathfloatlog10@}% + \pgfmathfloat@install@csname{pgfmathlog2@}{pgfmathfloatlog2@}% \pgfmathfloat@install\pgfmathsqrt@=\pgfmathfloatsqrt@% \pgfmathfloat@install\pgfmath@pi=\pgfmathfloatpi@% \pgfmathfloat@install\pgfmathpi=\pgfmathfloatpi@% \pgfmathfloat@install\pgfmathe@=\pgfmathfloate@% \pgfmathfloat@install\pgfmathe=\pgfmathfloate@% \pgfmathfloat@install\pgfmathlessthan@=\pgfmathfloatlessthan@% + \pgfmathfloat@install\pgfmathnotless@=\pgfmathfloatnotless@% + \pgfmathfloat@install\pgfmathnotgreater@=\pgfmathfloatnotgreater@% \pgfmathfloat@install\pgfmathless@=\pgfmathfloatlessthan@% \pgfmathfloat@install\pgfmathgreaterthan@=\pgfmathfloatgreaterthan@% \pgfmathfloat@install\pgfmathgreater@=\pgfmathfloatgreaterthan@% + \pgfmathfloat@install\pgfmathifthenelse@=\pgfmathfloatifthenelse@% + \pgfmathfloat@install\pgfmathequal@=\pgfmathfloatequal@% + \pgfmathfloat@install\pgfmathequalto@=\pgfmathfloatequal@% + \pgfmathfloat@install\pgfmathnotequal@=\pgfmathfloatnotequal@% + \pgfmathfloat@install\pgfmathnotequalto@=\pgfmathfloatnotequal@% \pgfmathfloat@install\pgfmathpow@=\pgfmathfloatpow@ \pgfmathfloat@install\pgfmathrand@=\pgfmathfloatrand@ \pgfmathfloat@install\pgfmathrand=\pgfmathfloatrand@ @@ -266,14 +290,10 @@ \pgfmathfloat@install\pgfmathtanh@=\pgfmathfloattanh@ \pgfmathfloat@install@unimplemented{ceil}% \pgfmathfloat@install@unimplemented{frac}% - \pgfmathfloat@install@unimplemented{log2}% - \pgfmathfloat@install@unimplemented{log10}% - \pgfmathfloat@install@unimplemented{equalto}% \pgfmathfloat@install@unimplemented{random}% \pgfmathfloat@install@unimplemented{setseed}% \pgfmathfloat@install@unimplemented{Mod}% \pgfmathfloat@install@unimplemented{real}% - \pgfmathfloat@install@unimplemented{notequal}% % \pgfmathfloat@install@unimplemented{atan2}% % \pgfmathfloat@install@unimplemented{height}% % @@ -648,6 +668,25 @@ \let\pgfmathfloatlessthan=\pgfmathfloatlessthan@ \let\pgfmathfloatless@=\pgfmathfloatlessthan@ +% ! (#1 < #2) <=> (#1 >= #2) +\def\pgfmathfloatnotless@#1#2{% + \pgfmathfloatless@{#1}{#2}% + \ifpgfmathfloatcomparison + \def\pgfmathresult{0.0}% + \else + \def\pgfmathresult{1.0}% + \fi +}% +% ! (#1 > #2) <=> (#1 <= #2) +\def\pgfmathfloatnotgreater@#1#2{% + \pgfmathfloatless@{#2}{#1}% + \ifpgfmathfloatcomparison + \def\pgfmathresult{0.0}% + \else + \def\pgfmathresult{1.0}% + \fi +}% + % compares \pgfmathfloat@a@[SME] < \pgfmathfloat@b@[SME] \def\pgfmathfloatlessthan@positive{% \ifnum\pgfmathfloat@a@E<\pgfmathfloat@b@E @@ -905,6 +944,34 @@ \ifnum\pgfmathfloatiffinite@>2 #3\else #2\fi }% +\def\pgfmathfloatifthenelse@#1#2#3{% + \pgfmathfloatifflags{#1}{0}{% + \edef\pgfmathresult{#3}%% + }{% + \edef\pgfmathresult{#2}% + }% +} +\def\pgfmathfloatequal@#1#2{% + \pgfmathfloatifapproxequalrel{#1}{#2}{% + \def\pgfmathresult{1}% + \pgfmathfloatcomparisontrue + }{% + \def\pgfmathresult{0}% + \pgfmathfloatcomparisonfalse + }% +} +\let\pgfmathfloatequalto@=\pgfmathfloatequal@ + +\def\pgfmathfloatnotequal@#1#2{% + \pgfmathfloatifapproxequalrel{#1}{#2}{% + \def\pgfmathresult{0}% + \pgfmathfloatcomparisonfalse + }{% + \def\pgfmathresult{1}% + \pgfmathfloatcomparisontrue + }% +} +\let\pgfmathfloatnotequalto@=\pgfmathfloatnotequal@ % Computes the relative error between #1 and #2 (assuming #2 != 0) and % invokes #3 if the relative error is below `/pgf/fpu/rel thresh' and @@ -953,7 +1020,7 @@ #4\relax \fi \else - \if\pgfmathfloat@loc@TMPa#2 + \if\pgfmathfloat@loc@TMPa#2% #3\relax \else #4\relax @@ -1441,8 +1508,13 @@ % assuming #2 != 0. \def\pgfmathfloatrelerror@#1#2{% \pgfmathfloatsubtract@{#1}{#2}% - \pgfmathfloatdivide@{\pgfmathresult}{#2}% - \pgfmathfloatabs@{\pgfmathresult}% + \let\pgfmathfloat@subtract=\pgfmathresult + \pgfmathfloatifflags{#2}{0}{% + \let\pgfmathresult=\pgfmathfloat@subtract + }{% + \pgfmathfloatdivide@{\pgfmathfloat@subtract}{#2}% + \pgfmathfloatabs@{\pgfmathresult}% + }% }% \let\pgfmathfloatrelerror=\pgfmathfloatrelerror@ @@ -1609,6 +1681,19 @@ } \let\pgfmathfloatln=\pgfmathfloatln@ +\expandafter\def\csname pgfmathfloatlog10@\endcsname#1{% + \pgfmathfloatln@{#1}% + \let\pgfmathfloat@log@ten=\pgfmathresult + \pgfmathfloatcreate{1}{4.34294481903252}{-1}% 1/ln(10) + \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@ten}% +}% +\expandafter\def\csname pgfmathfloatlog2@\endcsname#1{% + \pgfmathfloatln@{#1}% + \let\pgfmathfloat@log@two=\pgfmathresult + \pgfmathfloatcreate{1}{1.44269504088896}{0}% 1/ln(2) + \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@two}% +}% + % Computes log(x) into \pgfmathresult. % % This allows numbers such at 10000000 or 5.23e-10 to be represented diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex index 1cb2e67de17..e95a9a9957c 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% @@ -27,7 +27,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplothandlers.code.tex,v 1.15 2010/05/31 10:11:22 tantau Exp $ +\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplothandlers.code.tex,v 1.16 2011/12/28 18:51:18 ludewich Exp $ \newif\ifpgf@plot@started @@ -673,6 +673,45 @@ \xdef\pgf@plot@const@line@handler@last{\the\pgf@xa}% } +% A variant of \pgfplothandlerconstantlineto which places its mark on +% the middle of the line segment. +% +% ----x +% | +% --x--- | +% | |--x---- +% x-- +% +% Example: +% +% \pgfplothandlerconstantlinetomarkmid +% \pgfplotxyfile{mytable} +\def\pgfplothandlerconstantlinetomarkmid{% + \def\pgf@plotstreamstart{% + \global\let\pgf@plotstreampoint=\pgf@plot@const@line@mark@mid@handler% + \global\let\pgf@plotstreamspecial=\pgfutil@gobble% + \global\let\pgf@plotstreamend=\relax% + }% +} +\def\pgf@plot@const@line@mark@mid@handler#1{% + \pgf@process{#1}% + \xdef\pgf@plot@const@line@handler@last{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}% + \pgf@plot@first@action{}% + \global\let\pgf@plotstreampoint=\pgf@plot@const@line@mark@mid@handler@@% +} +\def\pgf@plot@const@line@mark@mid@handler@@#1{% + \pgf@process{#1}% + \pgf@xa=\pgf@x + \pgf@ya=\pgf@y + \pgf@plot@const@line@handler@last + \pgf@xc=.5\pgf@xa + \advance\pgf@xc by.5\pgf@x + \pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@y}}% + \pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@ya}}% + \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}% + \xdef\pgf@plot@const@line@handler@last{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}% +} + % This handler is in fact a variant of \pgfplothandlerconstantlineto, % but it does not draw vertical lines. It produces a sequence of % line-to and move-to operations such that plot marks are placed at @@ -747,6 +786,46 @@ \xdef\pgf@plot@const@line@handler@last{\the\pgf@ya}% } +% This handler is in fact a variant of +% \pgfplothandlerconstantlinetomarkmid, +% but it does not draw vertical lines. It produces a sequence of +% line-to and move-to operations such that plot marks are placed like +% +% ----x +% +% --x-- +% --x---- +% x-- +% +% Example: +% +% \pgfplothandlerjumpmarkmid +% \pgfplotxyfile{mytable} +\def\pgfplothandlerjumpmarkmid{% + \def\pgf@plotstreamstart{% + \global\let\pgf@plotstreampoint=\pgf@plot@jump@mark@mid@handler% + \global\let\pgf@plotstreamspecial=\pgfutil@gobble% + \global\let\pgf@plotstreamend=\relax% + }% +} +\def\pgf@plot@jump@mark@mid@handler#1{% + \pgf@process{#1}% + \xdef\pgf@plot@const@line@handler@last{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}% + \pgf@plot@first@action{}% + \global\let\pgf@plotstreampoint=\pgf@plot@jump@mark@mid@handler@@% +} +\def\pgf@plot@jump@mark@mid@handler@@#1{% + \pgf@process{#1}% + \pgf@xa=\pgf@x + \pgf@ya=\pgf@y + \pgf@plot@const@line@handler@last + \pgf@xc=.5\pgf@xa + \advance\pgf@xc by.5\pgf@x + \pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@y}}% + \pgfpathmoveto{\pgfqpoint{\pgf@xc}{\pgf@ya}}% + \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}% + \xdef\pgf@plot@const@line@handler@last{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}% +} % This handler converts each point in a stream into a line from the diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex index cabffe11ba6..4d59a1cba1b 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex index 380a696a1df..75a23d73422 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex index b6ca2c4e2e0..e3280455bb4 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex index 6ef0b8f63ff..2f2ce4d9716 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% @@ -817,21 +817,23 @@ % #1: the part before the exponent code % #2: the part for the exponent code. \def\pgfmathfloatrounddisplaystyle@shared@impl@#1#2{% - {\toks0={#1}% + \begingroup + \toks0={#1}% \toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}% \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }% - }% + \endgroup \let\pgfmathresult=\pgfmathfloat@glob@TMP }% % Same as \pgfmathfloatrounddisplaystyle@shared@impl@, but it also % inserts the '@dec sep mark' at the end. \def\pgfmathfloatrounddisplaystyle@shared@impl@@#1#2{% - {\toks0={#1}% + \begingroup + \toks0={#1}% \toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}% \pgfkeysgetvalue{/pgf/number format/@dec sep mark}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK \toks2=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK}% \xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 \the\toks2 }% - }% + \endgroup \let\pgfmathresult=\pgfmathfloat@glob@TMP } @@ -846,10 +848,11 @@ } \def\pgfmathfloatrounddisplaystyle@e#1#2e#3\relax{% \ifnum#3<0\relax - {\count0=#3\relax + \begingroup + \count0=#3\relax \multiply\count0 by-1 \xdef\pgfmathfloat@glob@TMP{e{-}\the\count0}% - }% + \endgroup% \let\pgfmathresult=\pgfmathfloat@glob@TMP \else \def\pgfmathresult{e{+}#3}% @@ -859,10 +862,11 @@ } \def\pgfmathfloatrounddisplaystyle@E#1#2e#3\relax{% \ifnum#3<0\relax - {\count0=#3\relax + \begingroup + \count0=#3\relax \multiply\count0 by-1 \xdef\pgfmathfloat@glob@TMP{E{-}\the\count0}% - }% + \endgroup% \let\pgfmathresult=\pgfmathfloat@glob@TMP \else \def\pgfmathresult{E{+}#3}% @@ -905,6 +909,8 @@ \long\def\pgfmathfloatfrac@verbatim#1#2{#1/#2}% +\let\pgfmathround@@orig=\pgfmathround@ + \newif\ifpgfmathprintnumber@thousand@sep@in@fractional \pgfkeys{% /pgf/number format/.is family, @@ -914,9 +920,15 @@ std/.code= {\pgfmath@set@number@printer{pgfmathprintnumber@STD}\pgfmathprintnumber@STD@setparam{#1}}, std/.default=,% % relative={<exponent base 10>} - relative/.code= {\pgfmath@set@number@printer{pgfmathprintnumber@RELATIVE}\def\pgfmathprintnumber@RELATIVE@param{#1}},% + relative/.code= {% + \pgfmath@set@number@printer{pgfmathprintnumber@RELATIVE}% + \pgfmathround@@orig{#1}% + \expandafter\pgfmathfloattoint@@\pgfmathresult\relax + \let\pgfmathprintnumber@RELATIVE@param=\pgfmathresult + },% relative/.value required, every relative/.style=std, + fixed relative/.code= \pgfmath@set@number@printer{pgfmathprintnumber@FIXED@RELATIVE}, int detect/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@DETECT}, int trunc/.code= \pgfmath@set@number@printer{pgfmathprintnumber@INT@TRUNC}, frac/.code= \pgfmath@set@number@printer{pgfmathprintnumber@frac},% @@ -1101,7 +1113,9 @@ \ifpgfmathfloatroundhasperiod\else.0\fi e\the\pgfmathfloat@a@E}% % call another formatter for the result (but avoid rounding inside of it): - \pgfqkeys{/pgf/number format}{/pgf/number format/every relative}% + \pgfqkeys{/pgf/number format}{/pgf/number format/every relative, + fixed zerofill=false,% useless here! + sci zerofill=false}% \ifx\pgfmathprintnumber@issci\pgfmathprintnumber@RELATIVE@issci \pgfmath@error{The '/pgf/number format/every relative' style should set a valid display style}% \fi @@ -1112,6 +1126,39 @@ \endgroup } +\def\pgfmathprintnumber@FIXED@RELATIVE#1{% + % parse the input: + \pgfmathfloatparsenumber{#1}% + \pgfmathfloat@to@FMeE@style\pgfmathresult + \expandafter\pgfmathprintnumber@FIXED@RELATIVE@issci\pgfmathresult\relax +} + +\def\pgfmathprintnumber@FIXED@RELATIVE@issci#1#2e#3\relax{% + \begingroup + \pgfmathfloatcreate{#1}{#2}{#3}% + % we want the first <precision> digits - not the first + % <precision>+1 digits: + \c@pgf@counta=\pgfmathfloat@round@precision\relax + \advance\c@pgf@counta by-1 + \edef\pgfmathfloat@round@precision{\the\c@pgf@counta}% + \pgfmathfloatround{\pgfmathresult}% + \pgfmathfloattoregisterstok\pgfmathresult\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E + \ifnum\pgfmathfloat@a@S=0 + \pgfmathfloat@a@E=\pgfmathfloat@a@S % avoid 0 * 10^8 + \fi + \edef\pgfmathresultX{% + \the\pgfmathfloat@a@S + \the\pgfmathfloat@a@Mtok + \ifpgfmathfloatroundhasperiod\else.0\fi + e\the\pgfmathfloat@a@E}% + \let\pgfmathfloat@round@precision@orig=\pgfmathfloat@round@precision + \pgfmathfloat@usezerofill@fixedfalse + \def\pgfmathfloat@round@precision{9999}% typeset all remaining digits! + \expandafter\pgfmathprintnumber@FIXED@issci\pgfmathresultX\relax% + \pgfmath@smuggleone\pgfmathresult + \endgroup +} + \def\pgfmathprintnumber@frac#1{% % parse the input: \pgfmathfloatparsenumber{#1}% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty index 7dc97116753..550951ca3b5 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex index 2d7a81b2bf5..d49d8d634c4 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex index badd22fd89d..b83ab9123e5 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex index bca33bab29e..7e2316ee45a 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex @@ -7,7 +7,7 @@ % % It is based on Till Tantau's PGF package. % -% Copyright 2007/2008/2009 by Christian Feuersänger. +% Copyright 2007-2012 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 @@ -36,6 +36,7 @@ \input pgfplotsplothandlers.code.tex \input pgfplotscoordprocessing.code.tex \input pgfplotsticks.code.tex +\input pgfplots.paths.code.tex @@ -1133,6 +1134,7 @@ /pgfplots/minor ytick={#1}, /pgfplots/minor ztick={#1}, }, + /pgfplots/minor tick/.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, @@ -1178,6 +1180,36 @@ % #1 = basis % #2 = exponent /pgfplots/log number format basis/.code 2 args={$#1^{\pgfmathprintnumber{#2}}$}, + % + % #1= number formatting options + /pgfplots/log ticks with fixed point/.style={ + /pgfplots/log number format basis/.code 2 args={ + \begingroup + \edef\pgfplots@exponent{##2}% + \pgfkeysalso{/pgf/fpu}% + % configure the style to avoid crap like + % 10,000.2 or 0.000999937 : + \pgfqkeys{/pgf/number format}{% + % it is rounded relative to its (individual!) order of + % magnitude: + fixed relative, + % ... and with three digits relative to its order of + % magnitude. This should avoid rounding problems + % since it is applied to each tick number + % individually. + precision=3, + }% + \ifdim##1pt=10pt + \def\pgfplots@baselog{2.30258509299405}% + \else + \pgfmathparse{ln(##1)}% + \let\pgfplots@baselog=\pgfmathresult + \fi + \pgfmathparse{exp(\pgfplots@exponent*\pgfplots@baselog)}% + \pgfmathprintnumber[#1]\pgfmathresult + \endgroup + }, + }, % takes #1 = [xyz]: /pgfplots/log basis ticks/.style={% /pgfplots/every #1 tick label/.append style={% @@ -1488,6 +1520,8 @@ };% }% }, + /pgfplots/line legend/.style/.code={\pgfplots@error{This style is supposed to be constant.}},% + /pgfplots/line legend/.append style/.code={\pgfplots@error{This style is supposed to be constant.}},% /pgfplots/line legend, /pgfplots/legend image code/.belongs to family=/pgfplots/legend, /pgfplots/reverse legend/.is if=pgfplots@reverse@legend, @@ -1517,7 +1551,7 @@ /pgfplots/at/.belongs to family=/pgfplots, /pgfplots/trim axis left/.code={% \pgfutil@ifundefined{pgfsettrimleft}{% - \pgfplots@error{Sorry, the 'trim axis left' requires a more recent PGF version. At the time of this writing, only the experimental PGF version available from texexample.net supports it.}% + \pgfplots@error{Sorry, the 'trim axis left' requires a more recent PGF version.}% }{% \pgfkeysalso{/tikz/trim left=(current axis.south west)}% }% @@ -1525,7 +1559,7 @@ /tikz/trim axis left/.style={/pgfplots/trim axis left}, /pgfplots/trim axis right/.code={% \pgfutil@ifundefined{pgfsettrimleft}{% - \pgfplots@error{Sorry, the 'trim axis right' requires a more recent PGF version. At the time of this writing, only the experimental PGF version available from texexample.net supports it.}% + \pgfplots@error{Sorry, the 'trim axis right' requires a more recent PGF version.}% }{% \pgfkeysalso{/tikz/trim right=(current axis.south east)}% }% @@ -2439,6 +2473,39 @@ },% },% /pgfplots/nodes near coords*/.default={\pgfmathprintnumber\pgfplotspointmeta}, + /pgfplots/scatter explicit color/.style 2 args={% + /pgfplots/scatter/@pre marker code/.code=,% + /pgfplots/scatter/@post marker code/.code=,% + /pgfplots/scatter explicit color*={#1}{#2},% + },% + /pgfplots/scatter explicit color*/.style 2 args={% + /pgfplots/point meta=explicit symbolic, + /pgfplots/scatter/true*,% + /pgfplots/scatter/@pre marker code/.append code={% + \edef\pgfplots@loc@TMPa{\noexpand\pgfutil@definecolor{mapped color}{#1}{\pgfplotspointmeta}}% + \pgfplots@loc@TMPa + \scope[#2]% + },% + /pgfplots/scatter/@post marker code/.prefix code={% + \endscope + },% + }, + /pgfplots/scatter rgb/.style={% + /pgfplots/scatter/@pre marker code/.code=,% + /pgfplots/scatter/@post marker code/.code=,% + /pgfplots/scatter rgb*={#1},% + }, + /pgfplots/scatter rgb*/.style={/pgfplots/scatter explicit color*={rgb}{#1}}, + /pgfplots/scatter rgb*/.default={draw=mapped color!80!black,fill=mapped color}, + % + /pgfplots/scatter cmyk/.style={% + /pgfplots/scatter/@pre marker code/.code=,% + /pgfplots/scatter/@post marker code/.code=,% + /pgfplots/scatter cmyk*={#1},% + }, + /pgfplots/scatter cmyk*/.style={/pgfplots/scatter explicit color*={cmyk}{#1}}, + /pgfplots/scatter cmyk*/.default={draw=mapped color!80!black,fill=mapped color}, + % /pgfplots/visualization depends on/list/.initial=,% /pgfplots/visualization depends on/.style={% /pgfplots/visualization depends on/list/.add={}{,{#1}}% @@ -2653,6 +2720,7 @@ at={(0pt,0pt)}, rectangle }, + /tikz/pos segment/.initial=, % empty line=none|auto|scanline|nan|jump % nan and jump is the same. /pgfplots/empty line/.initial=auto, @@ -3126,6 +3194,7 @@ /pgfplots/compat/anchors/1.3/.code= {\pgfplots@deprecated@anchorsfalse},% /pgfplots/compat/anchors/1.4/.style= {/pgfplots/compat/anchors/1.3},% /pgfplots/compat/anchors/1.5/.style= {/pgfplots/compat/anchors/1.3},% + /pgfplots/compat/anchors/1.5.1/.style= {/pgfplots/compat/anchors/1.3},% /pgfplots/compat/anchors/newest/.style= {/pgfplots/compat/anchors/1.3},% /pgfplots/compat/anchors/default/.style={/pgfplots/compat/anchors/1.3},% % @@ -3134,9 +3203,20 @@ /pgfplots/compat/empty line/1.3/.style= {/pgfplots/compat/empty line/pre 1.3},% /pgfplots/compat/empty line/1.4/.code= {\pgfplots@emptyline@compatfalse},% /pgfplots/compat/empty line/1.5/.style= {/pgfplots/compat/empty line/1.4},% + /pgfplots/compat/empty line/1.5.1/.style= {/pgfplots/compat/empty line/1.4},% /pgfplots/compat/empty line/newest/.style= {/pgfplots/compat/empty line/1.4},% /pgfplots/compat/empty line/default/.style={/pgfplots/compat/empty line/1.4},% % + /pgfplots/compat/path replacement/.is choice, + /pgfplots/compat/path replacement/pre 1.3/.code= {\pgfplots@path@replace@ellipsefalse}, + /pgfplots/compat/path replacement/1.3/.style= {/pgfplots/compat/path replacement/pre 1.3},% + /pgfplots/compat/path replacement/1.4/.style= {/pgfplots/compat/path replacement/pre 1.3}, + /pgfplots/compat/path replacement/1.5/.style= {/pgfplots/compat/path replacement/pre 1.3},% + /pgfplots/compat/path replacement/1.5.1/.code= {\pgfplots@path@replace@ellipsetrue},% + /pgfplots/compat/path replacement/newest/.style= {/pgfplots/compat/path replacement/1.5.1},% + /pgfplots/compat/path replacement/default/.style={/pgfplots/compat/path replacement/pre 1.3},% + %ellipse/.is if=pgfplots@path@replace@ellipse, + % /pgfplots/compat/labels/.is choice, /pgfplots/compat/labels/pre 1.3/.style={% /pgfplots/xlabel absolute, @@ -3146,6 +3226,7 @@ /pgfplots/ylabel near ticks},% /pgfplots/compat/labels/1.4/.style= {/pgfplots/compat/labels/1.3},% /pgfplots/compat/labels/1.5/.style= {/pgfplots/compat/labels/1.3},% + /pgfplots/compat/labels/1.5.1/.style= {/pgfplots/compat/labels/1.3},% /pgfplots/compat/labels/newest/.style= {/pgfplots/compat/labels/1.3},% /pgfplots/compat/labels/default/.style= {/pgfplots/compat/labels/pre 1.3},% maintain backwards compatibility for labels :-( % @@ -3160,13 +3241,16 @@ \def\pgfplots@compat@scaling@zunitfix@enable{1}% \def\pgfplots@compat@scaling@coordmath{float}}, /pgfplots/compat/scaling/1.5/.style={/pgfplots/compat/scaling/1.4}, + /pgfplots/compat/scaling/1.5.1/.style={/pgfplots/compat/scaling/1.4}, /pgfplots/compat/scaling/newest/.style={/pgfplots/compat/scaling/1.4}, /pgfplots/compat/scaling/default/.style={/pgfplots/compat/scaling/1.4}, + % /pgfplots/compat/general/.is choice, /pgfplots/compat/general/pre 1.3/.style={/pgfplots/log origin=infty},% /pgfplots/compat/general/1.3/.style={/pgfplots/compat/general/pre 1.3}, /pgfplots/compat/general/1.4/.style={/pgfplots/compat/general/pre 1.3},% /pgfplots/compat/general/1.5/.style={/pgfplots/compat/general/newest},% + /pgfplots/compat/general/1.5.1/.style={/pgfplots/compat/general/newest},% /pgfplots/compat/general/newest/.style={/pgfplots/log origin=0}, /pgfplots/compat/general/default/.style={/pgfplots/compat/general/newest}, /pgfplots/compat/.style={% @@ -3177,6 +3261,7 @@ /pgfplots/compat/empty line=#1,% /pgfplots/compat/scaling=#1,% /pgfplots/compat/general=#1,% + /pgfplots/compat/path replacement=#1,% },% /pgfplots/compat/.default=pre 1.3,% this is used if you type '\pgfplotsset{compat}' without value /pgfplots/compat=default,% this is the initial config. @@ -4000,6 +4085,7 @@ \long\def\pgfplots@show@small@legendplots#1#2{% \begingroup \pgfplots@define@currentplotstyle@as{#1,#2}% + \pgfplots@restore@state@before@legend@style \scope[/tikz/current plot style,/pgfplots/every legend image post]% this scoping construction allows plot styles to change 'legend image code'. \pgfkeysvalueof{/pgfplots/legend image code/.@cmd}\pgfeov \endscope @@ -4007,6 +4093,14 @@ %\pgfkeysvalueof{/pgfplots/legend image code/.@cmd}{/pgfplots/.cd,#1,#2}\pgfeov } +% A work-around method to undo the 'every axis legend' style. +% +% It is called within legend's cell pictures in order to undo global +% settings like stroke colors or the-like. +\def\pgfplots@restore@state@before@legend@style{% + \pgfsetfillcolor{black}% +}% + \def\pgfplots@split@opts{% \pgfutil@ifnextchar[{% \pgfplots@split@opts@opts @@ -4037,6 +4131,7 @@ \expandafter\pgfplots@assign@list\expandafter\pgfplots@legend\expandafter{\pgfplots@legend}% \pgfplotslistcheckempty\pgfplots@legend \fi +%\message{Legend: \meaning\pgfplots@legend^^J}% \ifpgfplotslistempty \else \ifpgfplots@reverse@legend @@ -4189,7 +4284,7 @@ \let\pgfplots@already@computed@legend@node=\pgfplots@glob@TMPa \fi \fi -%\pgfplots@message{Vor legende: \meaning\pgfplots@already@computed@legend@node^^J}% +%\message{Vor legende: \meaning\pgfplots@already@computed@legend@node^^J}% \ifx\pgfplots@createlegend@toname\pgfutil@empty % DRAW: \pgfplots@already@computed@legend@node @@ -4708,32 +4803,20 @@ % % 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. + % this here should also work with 'xtick=\empty', the "No tick" command. \ifx\pgfplots@loc@TMPa\pgfutil@empty \else \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 + \edef\pgfplots@loc@TMPa{\csname pgfplots@firstplot@coords@#1\endcsname}% \expandafter\pgfplotsutil@unify@short@csv@list\expandafter{\pgfplots@loc@TMPa}% - \t@pgfplots@toka=\expandafter{\pgfplotsretval}% - \edef\pgfplots@loc@TMPa{{\the\t@pgfplots@toka}}% - \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks@isfloat\pgfplots@loc@TMPa - {\pgfplotscoordmath{#1}{datascaletrafo}}% - \to\pgfplots@loc@TMPc - % clear structure: - \expandafter\global\expandafter\let\csname pgfplots@firstplot@coords@#1\endcsname=\pgfutil@empty - \else - \t@pgfplots@toka=\expandafter{\pgfplots@loc@TMPa}% -%\message{Converting #1tick='\csname pgfplots@#1tick\endcsname'}% - \edef\pgfplots@loc@TMPa{{\the\t@pgfplots@toka}}% - \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks\pgfplots@loc@TMPa - {\pgfplotscoordmath{#1}{datascaletrafo}}% - \to\pgfplots@loc@TMPc + \let\pgfplots@loc@TMPa=\pgfplotsretval \fi +%\message{Converting #1tick='\csname pgfplots@#1tick\endcsname'}% + \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks\expandafter{\pgfplots@loc@TMPa}% + {\pgfplotscoordmath{#1}{datascaletrafo}}% + \to\pgfplots@loc@TMPc \expandafter\let\csname pgfplots@#1tick\endcsname=\pgfplots@loc@TMPc \fi % @@ -4750,10 +4833,17 @@ % % Convert any minor tick lists in the same way. \pgfkeysgetvalue{/pgfplots/minor #1tick}\pgfplots@loc@TMPa + \edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa}% \ifx\pgfplots@loc@TMPa\pgfutil@empty \else - \edef\pgfplots@loc@TMPa{{\pgfplots@loc@TMPa}}% - \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks\pgfplots@loc@TMPa + \def\pgfplots@loc@TMPb{data}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + % we have #1tick = data + \edef\pgfplots@loc@TMPa{\csname pgfplots@firstplot@coords@#1\endcsname}% + \expandafter\pgfplotsutil@unify@short@csv@list\expandafter{\pgfplots@loc@TMPa}% + \let\pgfplots@loc@TMPa=\pgfplotsretval + \fi + \expandafter\pgfplots@apply@data@scale@trafo@to@user@ticks\expandafter{\pgfplots@loc@TMPa}% {\pgfplotscoordmath{#1}{datascaletrafo}}% \to\pgfplots@loc@TMPc \pgfkeyslet{/pgfplots/minor #1tick}\pgfplots@loc@TMPc @@ -4766,11 +4856,19 @@ \pgfplotscoordmath{#1}{datascaletrafo set params}{0}{0}% \def\pgfplots@loc@TMPb{data}% \expandafter\ifx\csname pgfplots@#1tick\endcsname\pgfplots@loc@TMPb - \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@firstplot@coords@#1\endcsname + \edef\pgfplots@loc@TMPa{\csname pgfplots@firstplot@coords@#1\endcsname}% \expandafter\pgfplotsutil@unify@short@csv@list\expandafter{\pgfplots@loc@TMPa}% \expandafter\let\csname pgfplots@#1tick\endcsname=\pgfplotsretval% - % clear structure: - \expandafter\global\expandafter\let\csname pgfplots@firstplot@coords@#1\endcsname=\pgfutil@empty + \fi + \pgfkeysgetvalue{/pgfplots/minor #1tick}\pgfplots@loc@TMPa + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \else + \def\pgfplots@loc@TMPb{data}% + \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb + \edef\pgfplots@loc@TMPa{\csname pgfplots@firstplot@coords@#1\endcsname}% + \expandafter\pgfplotsutil@unify@short@csv@list\expandafter{\pgfplots@loc@TMPa}% + \pgfkeyslet{/pgfplots/minor #1tick}\pgfplotsretval + \fi \fi \expandafter\let\csname pgfplots@#1min@unscaled@as@float\endcsname=\pgfutil@empty \expandafter\let\csname pgfplots@#1max@unscaled@as@float\endcsname=\pgfutil@empty @@ -4912,6 +5010,10 @@ \ifpgfplots@threedim \pgfplots@check@and@apply@datatrafo@for z% \fi + % clear structure: + \global\let\pgfplots@firstplot@coords@x=\pgfutil@empty + \global\let\pgfplots@firstplot@coords@y=\pgfutil@empty + \global\let\pgfplots@firstplot@coords@z=\pgfutil@empty \pgfplots@datascaletrafo@initialisedtrue %\message{transformed: x = [\pgfplots@xmin:\pgfplots@xmax] y = [\pgfplots@ymin:\pgfplots@ymax].}% % @@ -4967,12 +5069,18 @@ \fi \ifpgfplots@determinedefaultvalues@needs@check@uniformtick \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1tick\endcsname - \pgfplots@if{pgfplots@#1islinear}{% - \def\pgfplots@loc@TMPb{\expandafter\pgfplots@checkisuniformLINEARtick\expandafter{\pgfplots@loc@TMPa}}% - \expandafter\pgfplots@loc@TMPb\csname pgfplots@tick@distance@#1\endcsname% - }{% - \expandafter\pgfplots@checkisuniformLOGtick\expandafter{\pgfplots@loc@TMPa}% - }% + \edef\pgfplots@loc@TMPb{\pgfplots@loc@TMPa}% + \ifx\pgfplots@loc@TMPb\pgfutil@empty + % there are no ticks left. + \pgfplots@isuniformtickfalse + \else + \pgfplots@if{pgfplots@#1islinear}{% + \def\pgfplots@loc@TMPb{\expandafter\pgfplots@checkisuniformLINEARtick\expandafter{\pgfplots@loc@TMPa}}% + \expandafter\pgfplots@loc@TMPb\csname pgfplots@tick@distance@#1\endcsname% + }{% + \expandafter\pgfplots@checkisuniformLOGtick\expandafter{\pgfplots@loc@TMPa}% + }% + \fi \fi \pgfplots@check@for@minor@ticks{#1}% \ifpgfplots@isuniformtick @@ -5647,7 +5755,18 @@ %\pgfplots@apply@unit@ratio@find@reference@checkexplicitlimits % \ifx\pgfplots@optimum@sofar@axis\pgfutil@empty + % set \pgfplots@loc@TMPa := 1 if and only if the axis is 3d + \def\pgfplots@loc@TMPa{0}% \ifpgfplots@threedim + % ah, it IS 3d! + \ifdim\pgfplots@z@veclength pt=0pt + % hm. It has view = {0}{90} (i.e. it is 2d) + \def\pgfplots@loc@TMPa{0}% + \else + \def\pgfplots@loc@TMPa{1}% + \fi + \fi + \if1\pgfplots@loc@TMPa % 3D is more complicated than 2D: % for every fixed reference axis, we have to check *two* % scaling factors. @@ -5744,11 +5863,15 @@ % \ifx\pgfplots@optimum@sofar@axis\pgfutil@empty \ifpgfplots@threedim - \def\pgfplots@optimum@sofar@axis{z}% + \ifdim\pgfplots@z@veclength pt=0pt + \def\pgfplots@optimum@sofar@axis{y}% + \else + \def\pgfplots@optimum@sofar@axis{z}% + \fi \else \def\pgfplots@optimum@sofar@axis{y}% \fi - \pgfplots@warning{The algorithm to realize 'unit vector ratio' failed! It could not determine the axis which shall be scaled and decided to use 'unit vector ratio axis=\pgfplots@optimum@sofar@axis'.}% + \pgfplots@warning{The algorithm to implement 'unit vector ratio' failed! It could not determine the axis which shall be scaled and decided to use 'unit vector ratio axis=\pgfplots@optimum@sofar@axis'.}% \fi \let\pgfplots@apply@unit@ratio@reference=\pgfplots@optimum@sofar@axis \pgfmath@smuggleone\pgfplots@apply@unit@ratio@reference @@ -5844,6 +5967,9 @@ \else \def\pgfplots@loc@TMPa{1}% \fi + \ifdim\csname pgfplots@#1@veclength\endcsname pt=0pt + \def\pgfplots@loc@TMPa{0}% + \fi \if1\pgfplots@loc@TMPa % \pgfplots@getscale@unit@vector@reltoreference{#1}{#2}% @@ -5959,46 +6085,58 @@ % Part 1: compute % #2 * ||e_ref|| / ||e_#1||. % - \pgfmathmultiply@ - {\csname pgfplots@\pgfplots@apply@unit@ratio@reference @veclength\endcsname} - {\csname pgfplots@#1@inverseveclength\endcsname}% - \pgfmathmultiply@ - {\pgfmathresult}% - {#2}% - \global\let\pgfplots@glob@TMPa=\pgfmathresult - % - % also compute 1/s, required as temporary value: - %\pgfmathmultiply@ - % {\csname pgfplots@\pgfplots@apply@unit@ratio@reference @inverseveclength\endcsname} - % {\csname pgfplots@#1@veclength\endcsname}% - %\ifdim#2pt=1pt - %\else - % \pgfmathdivide@{\pgfmathresult}{#2}% - %\fi - %\global\let\pgfplots@glob@TMPb=\pgfmathresult - % - % Part 2: handle data scaling trafo scales: - \begingroup - \def\pgfplots@tmp@exponentref{0}% - \def\pgfplots@tmp@exponentK{0}% - \pgfplots@if{pgfplots@apply@datatrafo@\pgfplots@apply@unit@ratio@reference }{% - \pgfplots@letcsname{pgfplots@tmp@exponentref}={pgfplots@data@scale@trafo@EXPONENT@\pgfplots@apply@unit@ratio@reference }% - }{}% - \pgfplots@if{pgfplots@apply@datatrafo@#1}{% - \pgfplots@letcsname{pgfplots@tmp@exponentK}={pgfplots@data@scale@trafo@EXPONENT@#1}% - }{}% - \c@pgf@counta=\pgfplots@tmp@exponentref\relax - \advance\c@pgf@counta by-\pgfplots@tmp@exponentK\relax - \ifnum\c@pgf@counta=0 - \else - \pgfplotsmathmultiplypowten@{\pgfplots@glob@TMPa}{\c@pgf@counta}% - \global\let\pgfplots@glob@TMPa=\pgfmathresult - % \pgfplotsmathmultiplypowten@{\pgfplots@glob@TMPb}{-\c@pgf@counta}% - % \global\let\pgfplots@glob@TMPb=\pgfmathresult + \def\pgfplots@loc@TMPa{1}% + \ifdim\csname pgfplots@#1@veclength\endcsname pt=0pt + \def\pgfplots@loc@TMPa{0}% + \else + \ifdim\csname pgfplots@\pgfplots@apply@unit@ratio@reference @veclength\endcsname pt=0pt + \def\pgfplots@loc@TMPa{0}% \fi - \xdef\pgfplots@glob@TMPc{\the\c@pgf@counta}% - \endgroup - \let\pgfmathresult=\pgfplots@glob@TMPa + \fi + \if0\pgfplots@loc@TMPa + \def\pgfmathresult{16001}% + \else + \pgfmathmultiply@ + {\csname pgfplots@\pgfplots@apply@unit@ratio@reference @veclength\endcsname} + {\csname pgfplots@#1@inverseveclength\endcsname}% + \pgfmathmultiply@ + {\pgfmathresult}% + {#2}% + \global\let\pgfplots@glob@TMPa=\pgfmathresult + % + % also compute 1/s, required as temporary value: + %\pgfmathmultiply@ + % {\csname pgfplots@\pgfplots@apply@unit@ratio@reference @inverseveclength\endcsname} + % {\csname pgfplots@#1@veclength\endcsname}% + %\ifdim#2pt=1pt + %\else + % \pgfmathdivide@{\pgfmathresult}{#2}% + %\fi + %\global\let\pgfplots@glob@TMPb=\pgfmathresult + % + % Part 2: handle data scaling trafo scales: + \begingroup + \def\pgfplots@tmp@exponentref{0}% + \def\pgfplots@tmp@exponentK{0}% + \pgfplots@if{pgfplots@apply@datatrafo@\pgfplots@apply@unit@ratio@reference }{% + \pgfplots@letcsname{pgfplots@tmp@exponentref}={pgfplots@data@scale@trafo@EXPONENT@\pgfplots@apply@unit@ratio@reference }% + }{}% + \pgfplots@if{pgfplots@apply@datatrafo@#1}{% + \pgfplots@letcsname{pgfplots@tmp@exponentK}={pgfplots@data@scale@trafo@EXPONENT@#1}% + }{}% + \c@pgf@counta=\pgfplots@tmp@exponentref\relax + \advance\c@pgf@counta by-\pgfplots@tmp@exponentK\relax + \ifnum\c@pgf@counta=0 + \else + \pgfplotsmathmultiplypowten@{\pgfplots@glob@TMPa}{\c@pgf@counta}% + \global\let\pgfplots@glob@TMPa=\pgfmathresult + % \pgfplotsmathmultiplypowten@{\pgfplots@glob@TMPb}{-\c@pgf@counta}% + % \global\let\pgfplots@glob@TMPb=\pgfmathresult + \fi + \xdef\pgfplots@glob@TMPc{\the\c@pgf@counta}% + \endgroup + \let\pgfmathresult=\pgfplots@glob@TMPa + \fi %\message{\string\pgfplots@getscale@unit@vector@reltoreference{#1}{#2} (reference \pgfplots@apply@unit@ratio@reference) = \pgfmathresult.^^J}% } @@ -7826,6 +7964,7 @@ \noexpand\pgfpathlineto{\the\toks1 }% \noexpand\pgfpathlineto{\the\toks2 }% \noexpand\pgfpathlineto{\the\toks3 }% + \noexpand\pgfpathclose \noexpand\pgfplots@clippath@use@{##1}% }% \endgroup @@ -7847,6 +7986,7 @@ % clip path routine; it will be used quite often. % \let\pgfplots@clippath@install@pathcmd=\pgfplots@clippath@install + \iffalse% FIXME : this needs to be fixed \pgf@resetpathsizes% FIXME: this here should not be necessary! \pgfsysprotocol@getcurrentprotocol\pgfplots@loc@TMPa% \begingroup @@ -7864,6 +8004,7 @@ \endgroup \let\pgfplots@clippath@install@clip@protocolled=\pgfplots@glob@TMPa \pgfsysprotocol@setcurrentprotocol\pgfplots@loc@TMPa% + \fi % % Replace \pgfplots@clippath@install by one which makes use of the % optimized version (if ##1=\pgfusepath{clip}) @@ -7883,7 +8024,7 @@ }% % }% -\def\pgfplots@clippath@install@test{\pgfusepath{clip}X}% +\def\pgfplots@clippath@install@test{\pgfusepath{clip}X}% FIXME : deactivated \def\pgfplotspointbb@assertvaluesexist{% \ifx\pgfplotspoint@bb@@@\relax @@ -7987,6 +8128,16 @@ \def\pgfplotspointaxisxy#1#2{\pgfplots@evalute@tikz@coord@system@interface#1,#2\pgfplots@coord@end}% \def\pgfplotspointaxisxyz#1#2#3{\pgfplots@evalute@tikz@coord@system@interface#1,#2,#3\pgfplots@coord@end}% +\tikzdeclarecoordinatesystem{axis direction}{% + \edef\pgfplots@loc@TMPa{% + \noexpand\pgfplots@evalute@tikz@coord@system@interface[ noshift]% + #1\noexpand\pgfplots@coord@end + }% + \pgfplots@loc@TMPa +} +\def\pgfplotspointaxisdirectionxy#1#2{\pgfplots@evalute@tikz@coord@system@interface[ noshift]#1,#2\pgfplots@coord@end}% +\def\pgfplotspointaxisdirectionxyz#1#2#3{\pgfplots@evalute@tikz@coord@system@interface[ noshift]#1,#2,#3\pgfplots@coord@end}% + % rel axis cs: \tikzdeclarecoordinatesystem{rel axis}{\edef\pgfplots@loc@TMPa{#1}\expandafter\pgfplots@evalute@tikz@coord@system@interface@rel\pgfplots@loc@TMPa\pgfplots@coord@end} \def\pgfplotspointrelaxisxy#1#2{\pgfplots@evalute@tikz@coord@system@interface@rel#1,#2\pgfplots@coord@end}% @@ -7996,35 +8147,61 @@ \tikzdeclarecoordinatesystem{axis description}{\edef\pgfplots@loc@TMPa{#1}\expandafter\pgfplots@evalute@tikz@coord@system@interface@axis@description\pgfplots@loc@TMPa\pgfplots@coord@end} \def\pgfplots@evalute@tikz@coord@system@interface@axis@description#1,#2\pgfplots@coord@end{\pgfplotspointdescriptionxy{#1}{#2}} -\def\pgfplotstransformcoordinatex#1{\pgfplots@evalute@tikz@coord@system@interface@for{x}{#1}}% -\def\pgfplotstransformcoordinatey#1{\pgfplots@evalute@tikz@coord@system@interface@for{y}{#1}}% -\def\pgfplotstransformcoordinatez#1{\pgfplots@evalute@tikz@coord@system@interface@for{z}{#1}}% +\def\pgfplotstransformcoordinatex#1{\pgfplots@evalute@tikz@coord@system@interface@for[]{x}{#1}}% +\def\pgfplotstransformcoordinatey#1{\pgfplots@evalute@tikz@coord@system@interface@for[]{y}{#1}}% +\def\pgfplotstransformcoordinatez#1{\pgfplots@evalute@tikz@coord@system@interface@for[]{z}{#1}}% -% 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 - \edef\pgfmathresult{#2}% +\def\pgfplotstransformdirectionx#1{\pgfplots@evalute@tikz@coord@system@interface@for[ noshift]{x}{#1}}% +\def\pgfplotstransformdirectiony#1{\pgfplots@evalute@tikz@coord@system@interface@for[ noshift]{y}{#1}}% +\def\pgfplotstransformdirectionz#1{\pgfplots@evalute@tikz@coord@system@interface@for[ noshift]{z}{#1}}% + +\def\pgfplots@declare@mathfunctions{% + \pgfmathdeclarefunction{transformdirectionx}{1}{\pgfplotstransformdirectionx{##1}}% + \pgfmathdeclarefunction{transformdirectiony}{1}{\pgfplotstransformdirectiony{##1}}% + \pgfmathdeclarefunction{transformdirectionz}{1}{\pgfplotstransformdirectionz{##1}}% + % + \pgfmathdeclarefunction{transformcoordinatex}{1}{\pgfplotstransformcoordinatex{##1}}% + \pgfmathdeclarefunction{transformcoordinatey}{1}{\pgfplotstransformcoordinatey{##1}}% + \pgfmathdeclarefunction{transformcoordinatez}{1}{\pgfplotstransformcoordinatez{##1}}% +}% + +% Assigns \pgfmathresult := canvas coordinate (#3) for axis #2. +% +% A "canvas coordinate" here means an argument for \pgfplotsqpointxyz. +% +% #1: a command suffix which will be handed over to the datascale +% #2: an axis (x,y, or z) +% #3: the high-level coordinate which should be transformed +% trafo (typically an empty string) +\long\def\pgfplots@evalute@tikz@coord@system@interface@for[#1]#2#3{% + \pgfkeysgetvalue{/pgfplots/#2 coord trafo/.@cmd}\pgfplots@loc@TMPc + \edef\pgfmathresult{#3}% \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... - \csname ifpgfplots@#1islinear\endcsname - \pgfplots@if{pgfplots@apply@datatrafo@#1}{% - \pgfplotscoordmath{#1}{parsenumber}{\pgfplots@loc@TMPc}% - \pgfplotscoordmath{#1}{datascaletrafo}{\pgfmathresult}% + \csname ifpgfplots@#2islinear\endcsname + \pgfplotscoordmath{#2}{parsenumber}{\pgfplots@loc@TMPc}% + \pgfplots@if{pgfplots@apply@datatrafo@#2}{% + \pgfplotscoordmath{#2}{datascaletrafo#1}{\pgfmathresult}% }{}% \else - \pgfplotscoordmath{#1}{log}{\pgfplots@loc@TMPc}% + \pgfplotscoordmath{#2}{log}{\pgfplots@loc@TMPc}% \fi } -\long\def\pgfplots@evalute@tikz@coord@system@interface#1,#2\pgfplots@coord@end{% +\def\pgfplots@evalute@tikz@coord@system@interface{% + \pgfutil@ifnextchar[% + {\pgfplots@evalute@tikz@coord@system@interface@}% + {\pgfplots@evalute@tikz@coord@system@interface@[]}% +} +\long\def\pgfplots@evalute@tikz@coord@system@interface@[#1]#2,#3\pgfplots@coord@end{% \global\let\pgfplots@glob@TMPc=\pgfutil@empty \begingroup - \pgfplots@evalute@tikz@coord@system@interface@for{x}{#1}% + \pgfplots@evalute@tikz@coord@system@interface@for[#1]{x}{#2}% \let\pgfplots@evaluate@tikz@coord@x=\pgfmathresult - \edef\pgfplots@loc@TMPa{#2}% + \edef\pgfplots@loc@TMPa{#3}% \expandafter\pgfutil@in@\expandafter,\expandafter{\pgfplots@loc@TMPa}% \ifpgfutil@in@ \def\pgfplots@loc@TMPb##1,##2\pgfplots@EOI{% @@ -8032,12 +8209,12 @@ \def\pgfplots@axiscs@z{##2}% }% \expandafter\pgfplots@loc@TMPb\pgfplots@loc@TMPa\pgfplots@EOI - \pgfplots@evalute@tikz@coord@system@interface@for{y}{\pgfplots@axiscs@y}% + \pgfplots@evalute@tikz@coord@system@interface@for[#1]{y}{\pgfplots@axiscs@y}% \let\pgfplots@evaluate@tikz@coord@y=\pgfmathresult - \pgfplots@evalute@tikz@coord@system@interface@for{z}{\pgfplots@axiscs@z}% + \pgfplots@evalute@tikz@coord@system@interface@for[#1]{z}{\pgfplots@axiscs@z}% \let\pgfplots@evaluate@tikz@coord@z=\pgfmathresult \else - \pgfplots@evalute@tikz@coord@system@interface@for{y}{#2}% + \pgfplots@evalute@tikz@coord@system@interface@for[#1]{y}{#3}% \let\pgfplots@evaluate@tikz@coord@y=\pgfmathresult \let\pgfplots@evaluate@tikz@coord@z=\pgfutil@empty \fi @@ -8180,13 +8357,14 @@ \fi % % any user specified axis ticks: - \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1tick\endcsname + \edef\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 % #1tick=data is handled elsewhere... \else + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1tick\endcsname \expandafter\pgfplots@filter@input@ticks@with@highleveltrafo\expandafter{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPc}% \expandafter\edef\csname pgfplots@#1tick\endcsname{\pgfmathresult}% \fi @@ -8310,13 +8488,14 @@ \fi % % any user specified axis ticks: - \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1tick\endcsname + \edef\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 % #1tick=data is handled elsewhere... \else + \expandafter\let\expandafter\pgfplots@loc@TMPa\csname pgfplots@#1tick\endcsname \expandafter\pgfplots@filter@input@ticks@with@log\expandafter{\pgfplots@loc@TMPa}{#1}% \expandafter\edef\csname pgfplots@#1tick\endcsname{\pgfmathresult}% \fi @@ -9044,11 +9223,21 @@ \ifx\pgfplots@ztick\pgfplots@loc@TMPa \pgfplots@collect@firstplot@asticktrue \fi - \ifpgfplots@collect@firstplot@astick - \global\let\pgfplots@firstplot@coords@x=\pgfutil@empty - \global\let\pgfplots@firstplot@coords@y=\pgfutil@empty - \global\let\pgfplots@firstplot@coords@z=\pgfutil@empty + \pgfkeysgetvalue{/pgfplots/minor xtick}\pgfplots@loc@TMPb + \ifx\pgfplots@loc@TMPb\pgfplots@loc@TMPa + \pgfplots@collect@firstplot@asticktrue + \fi + \pgfkeysgetvalue{/pgfplots/minor ytick}\pgfplots@loc@TMPb + \ifx\pgfplots@loc@TMPb\pgfplots@loc@TMPa + \pgfplots@collect@firstplot@asticktrue + \fi + \pgfkeysgetvalue{/pgfplots/minor ztick}\pgfplots@loc@TMPb + \ifx\pgfplots@loc@TMPb\pgfplots@loc@TMPa + \pgfplots@collect@firstplot@asticktrue \fi + \global\let\pgfplots@firstplot@coords@x=\pgfutil@empty + \global\let\pgfplots@firstplot@coords@y=\pgfutil@empty + \global\let\pgfplots@firstplot@coords@z=\pgfutil@empty \pgfkeysalso{/pgfplots/.search also=/tikz}% % \pgfplots@set@options@sanitize @@ -9351,19 +9540,7 @@ \pgfplotsset{/tikz/draw,#1}% \pgfplots@invoke@pgfkeyscode{/handler config/all/.@cmd}{}% unrestrict % - % remember these technical things: they will be - % reset in \path (see below!), so we will need to re-activate - % them. - % The re-activation is done in 'every path' (see below). - % FIXME : is that portable!? - \pgfplots@assert@tikzinternal@exists{tikz@options}% - \pgfplots@assert@tikzinternal@exists{tikz@mode}% - \let\pgfplots@drawoptions=\tikz@options - \let\pgfplots@drawmodes=\tikz@mode - % - \pgfplots@check@for@default@plot@mark% - % - % As of February 22, the final plot processing uses + % the final plot processing uses % foreach stored \addplot command : % \scope[current plot style] % <finalize coord stream> @@ -9373,17 +9550,62 @@ % have been set in \scope! % -> ad-hoc-solution: % restore the modes manually. + \pgfplots@every@addplot@path@prepare% + % + \pgfplots@check@for@default@plot@mark% + % % % This is done here. The \pgfplots@drawmodes is ONLY set % inside of this scope, so we can check for that particular % case: \pgfkeys{/tikz/every path/.append code={% - \pgfplots@restore@drawmodes + % FIXME : is that portable!? + \pgfplots@every@addplot@path + \pgfplots@every@addplot@firstpath + \let\pgfplots@every@addplot@firstpath=\pgfutil@empty }% }% }% }% +\def\pgfplots@every@addplot@path{} +\def\pgfplots@every@addplot@firstpath{} + +\def\pgfplots@every@addplot@path@prepare{% + \let\pgfplots@every@addplot@path=\pgfutil@empty + \let\pgfplots@every@addplot@firstpath=\pgfutil@empty + % + % remember these technical things: they will be + % reset in \path (see below!), so we will need to re-activate + % them. + % The re-activation is done in 'every path'. + \pgfplots@assert@tikzinternal@exists{tikz@options}% + \pgfplots@assert@tikzinternal@exists{tikz@mode}% + \let\pgfplots@drawoptions=\tikz@options + \let\pgfplots@drawmodes=\tikz@mode + \pgfplots@everypath@prepare@append{\pgfplots@every@addplot@path}{\pgfplots@restore@drawmodes}% + % + \iftikz@decoratepath + \pgfplots@everypath@prepare@append{\pgfplots@every@addplot@firstpath}{\tikz@decoratepathtrue}% + \fi + \pgfplots@everypath@prepare@append@macrorestore{\pgfplots@every@addplot@firstpath}\tikz@preactions + \pgfplots@everypath@prepare@append@macrorestore{\pgfplots@every@addplot@firstpath}\tikz@postactions +}% +\long\def\pgfplots@everypath@prepare@append#1#2{% + \t@pgfplots@toka=\expandafter{#1}% + \t@pgfplots@tokb={#2}% + \edef#1{\the\t@pgfplots@toka\the\t@pgfplots@tokb}% +}% +\long\def\pgfplots@everypath@prepare@append@macrorestore#1#2{% + \t@pgfplots@toka=\expandafter{#1}% + \t@pgfplots@tokb=\expandafter{#2}% + \edef#1{% + \the\t@pgfplots@toka + \noexpand\def\noexpand#2{\the\t@pgfplots@tokb}% + }% +}% + + \newif\ifpgfplots@drawmodes@append \def\pgfplots@restore@drawmodes{% @@ -9559,6 +9781,7 @@ % \pgfplots@install@abbrev@commands \pgfplots@stacked@initialise + \pgfplotsplothandlers@init % % % The explicit specification of 'x' and 'y' as 1pt is to avoid @@ -9576,6 +9799,7 @@ % % % + % % -------------------- % Allocations: % -------------------- @@ -9657,6 +9881,8 @@ \pgfplots@autocompute@all@limitsfalse \fi % + \pgfplots@declare@mathfunctions + % % check for axis-wide 'point meta min' : \pgfkeysgetvalue{/pgfplots/point meta min}\pgfplots@loc@TMPa \ifx\pgfplots@loc@TMPa\pgfutil@empty @@ -9753,6 +9979,11 @@ % -> apply postponed drawing commands! % -------------------- \pgfplots@BEGIN@init@and@draw@axis + % + % replace some of tikz's paths (like ellipse and path): make them + % aware of any transformations: + \pgfplots@install@path@replacements + % \pgfplots@stacked@initialise \global\pgfplotslistnewempty\pgfplots@stored@markerlist \ifpgfplots@stacked@reverse @@ -9781,7 +10012,10 @@ % % this code here means we REALLY have a plotting % command! - \scope[current plot style] % this does set BOTH pgfplots and tikz options. + \scope[current plot style] % this sets BOTH pgfplots and tikz options. + % FIXME : what, precisely, was the motivation to use a + % scope here? It causes a lot of problems and + % work-arounds. Is it worth the effort!? % % de-activate the FPU here! I fear its number % format may cause errors when used in low-level diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.multiaxis.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.multiaxis.code.tex new file mode 100644 index 00000000000..0c6f9a7e292 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.multiaxis.code.tex @@ -0,0 +1,39 @@ +%-------------------------------------------- +% +% 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/2009 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/>. +% +%-------------------------------------------- + + +\def\pgfplots@environment@multiaxis{% + \pgfutil@ifnextchar[{\pgfplots@@environment@multiaxis}{\pgfplots@@environment@multiaxis[]}% +} +\def\pgfplots@@environment@multiaxis[#1]{% + \begingroup +} +\def\endpgfplots@environment@multiaxis{% + \endgroup +} +\tikzaddtikzonlycommandshortcutlet\multiaxis\pgfplots@environment@multiaxis +\tikzaddtikzonlycommandshortcutlet\endmultiaxis\endpgfplots@environment@multiaxis + diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.paths.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.paths.code.tex new file mode 100644 index 00000000000..077a3a2b95d --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.paths.code.tex @@ -0,0 +1,71 @@ +%-------------------------------------------- +% +% 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-2012 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/>. +% +%-------------------------------------------- +% + +\newif\ifpgfplots@path@replace@ellipse + +\def\pgfplots@install@path@replacements{% + \ifpgfplots@path@replace@ellipse + \let\tikz@do@circle=\pgfplots@path@@tikz@do@circle + \expandafter\def\expandafter\pgfinterruptpicture\expandafter{\pgfinterruptpicture + \let\tikz@do@circle=\pgfplots@path@@tikz@do@circle@orig + }% + \fi +}% + +\let\pgfplots@path@@tikz@do@circle@orig=\tikz@do@circle + +% This is a replacement for \tikz@do@circle which replaces the "xy" +% coordinate system by one which is compatible with pgfplots. +\def\pgfplots@path@@tikz@do@circle#1#2{% + \begingroup + \ifpgfplots@usefpu + \pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}% + \fi + \pgfmathparse{#1}% + \let\tikz@ellipse@x=\pgfmathresult% + \ifpgfmathunitsdeclared% + \pgfmathparse{#2}% + \let\tikz@ellipse@y=\pgfmathresult% + \ifpgfmathunitsdeclared% + \pgfpathellipse{\pgfpointorigin}{% + \pgfqpoint{\tikz@ellipse@x pt}{0pt}}{\pgfpoint{0pt}{\tikz@ellipse@y pt}}% + \else% + \PackageError{tikz}{You cannot mix dimensions and dimensionless values in an ellipse}{}% + \fi% + \else% + \pgfmathparse{#2}% + \let\tikz@ellipse@y=\pgfmathresult% + \ifpgfmathunitsdeclared% + \PackageError{tikz}{You cannot mix dimensions and dimensionless values in an ellipse}{}% + \else% + \pgfpathellipse{\pgfpointorigin} + {\pgfplotspointaxisdirectionxy{\tikz@ellipse@x}{0}} + {\pgfplotspointaxisdirectionxy{0}{\tikz@ellipse@y}}% + \fi% + \fi% + \endgroup +} diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex index e1bcc0a53d0..7ecfb8a5957 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex @@ -1,3 +1,3 @@ \def\pgfplotsrevision{% -1.5-1-gcc2f2d2 +1.5.1-4-g53e640f } diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex index 996dce22550..d230e0d1ed7 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex @@ -2520,7 +2520,6 @@ datascaletrafo inverse to fixed= \edef\pgfmathresult{##1}, datascaletrafo noshift inverse to fixed= \edef\pgfmathresult{##1}, datascaletrafo noshift= \edef\pgfmathresult{##1}, - datascaletrafo noshift= \edef\pgfmathresult{##1}, datascaletrafo undo shift= \edef\pgfmathresult{##1}, datascaletrafo redo shift= \edef\pgfmathresult{##1}, #2% @@ -2853,6 +2852,12 @@ }% }% +% Assumes that #2 is a macro, parses it as number with "coord math choice" #1, and overwrites it with the result. +\def\pgfplotscoordmathparsemacro#1#2{% + \pgfplotscoordmath{#1}{parsenumber}{#2}\let#2=\pgfmathresult +}% + + \pgfplotsdeclarecoordmath{pgfbasic}{% parsenumber=\pgfmathfloatparsenumber{#1}\pgfmathfloattofixed\pgfmathresult, suffix=@basic@, @@ -5502,8 +5507,12 @@ \pgfkeysgetvalue{/pgfplots/samples y}\pgfplots@plot@samples@y \fi % - \pgfkeyssetvalue{/pgfplots/mesh/rows}{\pgfkeysvalueof{/pgfplots/samples y}}% - \pgfkeyssetvalue{/pgfplots/mesh/cols}{\pgfkeysvalueof{/pgfplots/samples}}% + \iftikz@plot@raw@gnuplot + % FIXME : verify this case + \else + \pgfkeyssetvalue{/pgfplots/mesh/rows}{\pgfkeysvalueof{/pgfplots/samples y}}% + \pgfkeyssetvalue{/pgfplots/mesh/cols}{\pgfkeysvalueof{/pgfplots/samples}}% + \fi \if1\b@pgfplots@should@sample@LINE \pgfkeyssetvalue{/pgfplots/sample dim}{1}% \pgfkeyssetvalue{/pgfplots/mesh/cols}{1}% @@ -6355,7 +6364,15 @@ % high level user interface functions: \let\pgfplotstable@coordindex@old=\coordindex \def\coordindex{\pgfplotstablerow}% - \let\lineno=\coordindex% is the same here + \def\lineno{\coordindex}% is the same here + % These macros are-unfortunately- not accessable here. And the + % worst is: error messages are impossible either because they are + % not executed... try to provide useful hints: + \def\thisrow##1{thisrow_unavailable_load_table_directly}% + \def\thisrowno##1{thisrowno_unavailable_load_table_directly}% + % this should work. + \def\getthisrow##1##2{\pgfplotstablegetelem{\coordindex}{##1}\of{#3}{##2}}% + \def\getthisrowno##1##2{\pgfplotstablegetelem{\coordindex}{[index]##1}\of{#3}{##2}}% % \expandafter\pgfplotstablegetcolumnbyname\expandafter{\pgfplots@plot@tbl@x}\of#3\to\addplot@tbl@x \expandafter\pgfplotstablegetcolumnbyname\expandafter{\pgfplots@plot@tbl@y}\of#3\to\addplot@tbl@y @@ -7185,11 +7202,6 @@ % % It is prepared here to eliminate if's. \xdef\pgfplots@coord@stream@finalize@currentpt{% - \ifpgfplots@curplot@threedim - \E\pgfplotsqpointxyz{\E\pgfplots@current@point@x}{\E\pgfplots@current@point@y}{\E\pgfplots@current@point@z}% - \else - \E\pgfplotsqpointxy{\E\pgfplots@current@point@x}{\E\pgfplots@current@point@y}% - \fi % \ifpgfplots@record@marker@stream % remember the position (x,y) for markers. @@ -7215,13 +7227,24 @@ \ifx\pgfplots@current@point@x\pgfutil@empty% this realizes `unbounded coords=jump', for example \pgfplotsplothandlervisualizejump \else - \pgfplotsaxisvisphasetransformcoordinate\pgfplots@current@point@x\pgfplots@current@point@y\pgfplots@current@point@z% - \pgfplotsaxisvisphasepreparedatapoint + \pgfplotsaxisvisphasegetpoint \pgfplots@coord@stream@finalize@currentpt \fi }% } +% Takes the current point (defined by a set of macros) as input and defines \pgf@x and \pgf@y +% as the output point. +\def\pgfplotsaxisvisphasegetpoint{% + \pgfplotsaxisvisphasetransformcoordinate\pgfplots@current@point@x\pgfplots@current@point@y\pgfplots@current@point@z% + \pgfplotsaxisvisphasepreparedatapoint + \ifpgfplots@curplot@threedim + \pgfplotsqpointxyz{\pgfplots@current@point@x}{\pgfplots@current@point@y}{\pgfplots@current@point@z}% + \else + \pgfplotsqpointxy{\pgfplots@current@point@x}{\pgfplots@current@point@y}% + \fi +}% + \def\pgfplots@check@for@default@plot@mark{% % make sure there is a mark set! \pgfplots@gettikzinternal@keyval{mark}{tikz@plot@mark}{}% @@ -7335,6 +7358,250 @@ \fi }% +% This is the pgfplots implementation for 'node[pos=<fraction>]'. +% Besides modifications of the transformation matrix, it also defines the COORDINATES of the point to +% /data point/x +% /data point/y +% /data point/z +% (or more keys which depend on the plot handler). +\def\pgfplots@plot@timer{% + \pgfplotstransformplotattime{\tikz@time}% +} + +% Installs a transformation matrix such that (0,0) is the point of the +% current plot with fraction #1. +% +% This does actually nothing more than using +% \pgfplotspointplotattime{#1} as shift and using the slope of the +% curve at that point to set up the 'sloped' rotation (if enabled). +\def\pgfplotstransformplotattime#1{% + \pgftransformshift{\pgfplotspointplotattime{#1}}% + \ifpgfresetnontranslationattime% + \pgftransformresetnontranslations% + \fi% + \ifpgfslopedattime% + \pgfplotsplothandlertransformslopedattime{#1}{\pgfplotspointplotattimefirst}{\pgfplotspointplotattimesecond}% + \fi% +} + +\def\pgfplotspointplotattimeclearcache{% + \global\let\pgfplotspointplotattime@cache=\pgfutil@empty + \gdef\pgfplotspointplotattime@cachesize{0}% +}% +\pgfplotspointplotattimeclearcache +\def\pgfplotspointplotattime@cachesize@max{20} + +% Checks if the cache for \pgfplotspointplotattime has a cached entry for '#1'. +% POSTCONDITION: +% if \ifpgfplots@loc@tmp is true, the value(s) from the cache have been retrieved successfully. +% if \ifpgfplots@loc@tmp is false, there is not hit. +\def\pgfplotspointplotattimegetfromcache#1{% + \pgf@xa=#1pt % + \pgfplotspointplotattime@cache + \pgfkeysifdefined{/data point/@pos \the\pgf@xa/segment \pgfkeysvalueof{/tikz/pos segment}}{% + \pgfkeysvalueof{/data point/@pos \the\pgf@xa/segment \pgfkeysvalueof{/tikz/pos segment}}% + \pgfplots@loc@tmptrue + }{% + \pgfplots@loc@tmpfalse + }% +}% +\def\pgfplotspointplotattimeaddtocache#1{% + \pgfplotsutil@advancestringcounter@global\pgfplotspointplotattime@cachesize + \ifnum\pgfplotspointplotattime@cachesize=\pgfplotspointplotattime@cachesize@max + \pgfplotspointplotattimeclearcache + \fi + \pgf@xa=#1pt % + \edef\pgfplots@loc@TMPa{% + \noexpand\gdef\noexpand\pgfplotspointplotattimefirst{\pgfplotspointplotattimefirst}% + \noexpand\gdef\noexpand\pgfplotspointplotattimesecond{\pgfplotspointplotattimesecond}% + \noexpand\gdef\noexpand\pgfplotspointplotattimecoords{\pgfplotspointplotattimecoords}% + }% + \t@pgfplots@toka=\expandafter{\pgfplotspointplotattime@cache}% + \t@pgfplots@tokb=\expandafter{\pgfplots@loc@TMPa}% + \xdef\pgfplotspointplotattime@cache{% + \the\t@pgfplots@toka + \noexpand\pgfkeyssetvalue{/data point/@pos \the\pgf@xa/segment \pgfkeysvalueof{/tikz/pos segment}}{\the\t@pgfplots@tokb}% + }% +} + +% Sets (\pgf@x,\pgf@y) to the point of the current plot with fraction #1. +% For #1 = 0, this is the first point. +% For #1 = 1, this is the last point. +% For #1 = 0.5, it is the middle of the plot. +% The argument '#1' is optional: if you leave it away, the current value of the 'pos' key will be used. +% This method will work for most plot handlers, although some of them might be unsupported. +% +% As a side-effect, it defines the (global) macros +% - \pgfplotspointplotattimefirst the start coordinate of the line segment containing #1 +% - \pgfplotspointplotattimesecond the end coordinate of the line segment containing #1 +% - \pgfplotspointplotattimecoords the coordinates of #1 +% The first two are interesting in order to allow the computation of gradients. +% \pgfplotsplothandlerpointtokeys{/data point}% +% for the \pgfplotspointplotattimecoords point +% +% Any of these macros can be decoded using +% \pgfplotsplothandlerdeserializepointfrom\pgfplotspointplotattimesecond +% \pgfplotsaxisvisphasegetpoint +% +% @see \pgfplotsplothandlerpointtokeys +\def\pgfplotspointplotattime{% + \pgfutil@ifnextchar\bgroup{\pgfplotspointplotattime@}{\pgfplotspointplotattime@{\tikz@time}}% +} +\def\pgfplotspointplotattime@#1{% + \edef\pgfplots@loc@TMPa{#1}% + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \pgfplots@error{Sorry, the provided fraction of the plot is empty (maybe the argument of 'pos' has been cleared by the tikz node processing). Please provide a valid 'pos' argument}% + \else + \pgfplotspointplotattimegetfromcache{#1}% + \ifpgfplots@loc@tmp + % CACHE HIT! +%\message{CACHE HIT for \string\pgfplotspointplotattime{#1}^^J}% + \else +%\message{NO cache hit for \string\pgfplotspointplotattime{#1}^^J}% + \begingroup + % + \pgfkeysgetvalue{/tikz/pos segment}\pgfplots@pos@segment + % + % 1. compute the total length of the plot (by integrating along a linear spline) + % + \def\pgfplots@coord@stream@start@{% + \ifx\pgfplots@pos@segment\pgfutil@empty + \let\c@pgfplots@segments=\pgfutil@empty + \else + \def\c@pgfplots@segments{0}% + \c@pgf@countd=\pgfplots@pos@segment\relax + \edef\pgfplots@pos@segment{\the\c@pgf@countd}% + \fi + \pgfplotscoordmath{default}{zero}% + \let\pgfplots@len@total=\pgfmathresult + \let\pgfplots@last@processed=\pgfutil@empty + \def\pgfplots@last@was@empty{1}% + }% + \def\pgfplotspointattime@do{}% + \def\pgfplots@coord@stream@coord@{% +%\message{plot at time (#1, segment \pgfplots@pos@segment): processing (\pgfplots@current@point@x,\pgfplots@current@point@y,\pgfplots@current@point@z)^^J}% + \ifx\pgfplots@current@point@x\pgfutil@empty + \if1\pgfplots@last@was@empty + \else + % oh. a jump... start new length segment + \ifx\c@pgfplots@segments\pgfutil@empty + \else + \ifx\pgfplots@pos@segment\c@pgfplots@segments + \let\pgfplots@coord@stream@coord@=\relax + \fi + \pgfplotsutil@advancestringcounter\c@pgfplots@segments + \fi + \fi + \let\pgfplots@last@processed=\pgfutil@empty + \def\pgfplots@last@was@empty{1}% + \else + \ifx\pgfplots@pos@segment\c@pgfplots@segments + \ifx\pgfplots@last@processed\pgfutil@empty + \else + \pgfplotsplothandlerserializepointto{\pgfplots@cur}% + \pgfplotsplothandlersurveydifflen{\pgfplots@last@processed}{\pgfplots@cur}% + \pgfplotscoordmath{default}{op}{add}{{\pgfmathresult}{\pgfplots@len@total}}% + \let\pgfplots@len@total=\pgfmathresult +%\message{plot at time (#1, segment \pgfplots@pos@segment): length \pgfplots@len@total^^J}% + \pgfplotspointattime@do + \fi + % + \pgfplotsplothandlerserializepointto{\pgfplots@last@processed}% + \fi + \def\pgfplots@last@was@empty{0}% + \fi + }% + \def\pgfplots@coord@stream@end@{}% + \let\pgfplots@coord@stream@coord@orig=\pgfplots@coord@stream@coord@ + \expandafter\pgfplots@coord@stream@foreach@NORMALIZED\expandafter{\pgfplots@plot@timer@args}% + % + % Now, we have the total length. Now, try to find time #1! + \edef\pgfplots@time{#1}% + \pgfplotscoordmathparsemacro{default}{\pgfplots@time}% + % + \pgfplotscoordmath{default}{op}{multiply}{{\pgfplots@time}{\pgfplots@len@total}}% + \let\pgfplots@len@thresh=\pgfmathresult + % + \pgfplotscoordmath{default}{zero}% + \let\pgfplots@len@last=\pgfmathresult + \let\pgfplots@len@last@last=\pgfplots@len@last +%\message{plot at time (#1, segment \pgfplots@pos@segment): total length=\pgfplots@len@total; target len \pgfplots@len@thresh\space (#1)^^J}% + % + \def\pgfplots@HIT{0}% + \let\pgfplots@last@last=\pgfutil@empty + \let\pgfplots@coord@stream@coord@=\pgfplots@coord@stream@coord@orig + \def\pgfplotspointattime@do{% + \pgfplotscoordmath{default}{if less than} + {\pgfplots@len@thresh} + {\pgfplots@len@total} + {% HIT! + \def\pgfplots@HIT{1}% + \pgfplotspointattime@pointbetween@two + \let\pgfplots@coord@stream@coord@=\relax + }{% + }% + \let\pgfplots@len@last@last=\pgfplots@len@last + \let\pgfplots@len@last=\pgfplots@len@total + \let\pgfplots@last@last=\pgfplots@last@processed + \pgfplotsplothandlerserializepointto{\pgfplots@cur}% + }% + \expandafter\pgfplots@coord@stream@foreach@NORMALIZED\expandafter{\pgfplots@plot@timer@args}% + \if\pgfplots@HIT0% + \let\pgfplots@last@processed=\pgfplots@last@last + \let\pgfplots@len@last=\pgfplots@len@last@last + \pgfplotspointattime@pointbetween@two + \fi + \endgroup + \pgfplotspointplotattimeaddtocache{#1}% + \fi + \pgfplotsplothandlerdeserializepointfrom\pgfplotspointplotattimecoords + \pgfplotscoordmath{x}{tofixed}{\pgfplots@current@point@x}% + \pgfplots@coord@inv@trafo@apply{x}{\pgfmathresult}% + \let\pgfplots@current@point@x=\pgfmathresult + \pgfplotscoordmath{y}{tofixed}{\pgfplots@current@point@y}% + \pgfplots@coord@inv@trafo@apply{y}{\pgfmathresult}% + \let\pgfplots@current@point@y=\pgfmathresult + \ifpgfplots@curplot@threedim + \pgfplotscoordmath{z}{tofixed}{\pgfplots@current@point@z}% + \pgfplots@coord@inv@trafo@apply{z}{\pgfmathresult}% + \let\pgfplots@current@point@z=\pgfmathresult + \fi + \pgfplotsplothandlerpointtokeys{/data point}% + \fi +} +\def\pgfplotspointattime@pointbetween@two{% + \pgfplotscoordmath{default}{op}{subtract}{{\pgfplots@len@thresh}{\pgfplots@len@last}}% + \let\pgfplots@tmp=\pgfmathresult + \pgfplotscoordmath{default}{op}{subtract}{{\pgfplots@len@total}{\pgfplots@len@last}}% + \pgfplotscoordmath{default}{op}{divide}{{\pgfplots@tmp}{\pgfmathresult}}% + \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}% + \let\pgfplots@time@between@two=\pgfmathresult +%\message{HIT between \pgfplots@len@last\space and \pgfplots@len@total\space (\pgfplots@time@between@two)^^J}% + \ifx\pgfplots@last@processed\pgfutil@empty + \pgfplotsplothandlerserializepointto{\pgfplots@cur}% + \else + \pgfplotsplothandlersurveypointattime{\pgfplots@time@between@two}{\pgfplots@last@processed}{\pgfplots@cur}% + \fi + \pgfplotsplothandlerserializepointto\pgfplots@loc@TMPa + \global\let\pgfplotspointplotattimecoords=\pgfplots@loc@TMPa + \pgfplotsaxisvisphasegetpoint + \global\let\pgfplotspointplotattimefirst=\pgfplots@last@processed + \global\let\pgfplotspointplotattimesecond=\pgfplots@cur +}% + + +% #1 : either x,y, or z +% #2 : the argument on which the inv trafo shall be applied. It has to +% be a fixed point number. +\def\pgfplots@coord@inv@trafo@apply#1#2{% + \edef\pgfmathresult{#2}% + \pgfkeysgetvalue{/pgfplots/#1 coord inv trafo/.@cmd}\pgfplots@loc@TMPa + \ifx\pgfplots@loc@TMPa\pgfplots@empty@command@key + \else + \expandafter\pgfplots@loc@TMPa\expandafter{\pgfmathresult}\pgfeov + \fi +}% + % INPUT: % either floating point or fixed point coordinates (depending on the % state of the \ifpgfplots@apply@datatrafo boolean) @@ -7356,8 +7623,14 @@ \pgfutil@ifundefined{pgfplotlastpoint}{}{% \tikz@make@last@position{\pgfplotlastpoint}% }% + \let\pgfplots@plot@timer@args=\pgfplots@coord@stream@finalize@storedcoords@START@coords + \pgfplotspointplotattimeclearcache + \let\tikz@timer=\pgfplots@plot@timer% \endpgfextra #2; + % + \pgfplotspointplotattimeclearcache + % \ifx\pgfplots@recorded@marker@stream\pgfutil@empty \else \ifpgfplots@clip@marker@paths @@ -7648,7 +7921,7 @@ \if\pgfplots@log@origin@choice@x0% \global\let\pgfplots@logical@ZERO@x=\pgfplots@xmin% \else - \gdef\pgfplots@logical@ZERO@x{1}% + \gdef\pgfplots@logical@ZERO@x{0}% \fi \fi % @@ -7668,7 +7941,7 @@ \if\pgfplots@log@origin@choice@y0% \global\let\pgfplots@logical@ZERO@y=\pgfplots@ymin% \else - \gdef\pgfplots@logical@ZERO@y{1}% + \gdef\pgfplots@logical@ZERO@y{0}% \fi \fi % @@ -7689,7 +7962,7 @@ \if\pgfplots@log@origin@choice@z0% \global\let\pgfplots@logical@ZERO@z=\pgfplots@zmin% \else - \gdef\pgfplots@logical@ZERO@z{1}% + \gdef\pgfplots@logical@ZERO@z{0}% \fi \fi \fi diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex index 63cd7be107c..5084cd21b1e 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex @@ -362,6 +362,20 @@ }{\pgfplotspointmetatransformed}% }% },% + fill path={% + \def\b@pgfplotsmeshplothandler@fillpath@default@isfirst{1}% + \pgfplotspatchclass{\pgfplotspatchclassname}{foreach vertex}{% +%\message{vertex (\pgfplotspatchvertexx,\pgfplotspatchvertexy[\pgfplotspatchvertexmeta]. ^^J}% + \if1\b@pgfplotsmeshplothandler@fillpath@default@isfirst + \expandafter\pgfpathmoveto + \else + \expandafter\pgfpathlineto + \fi + {\global\pgf@x=\pgfplotspatchvertexx\space\global\pgf@y=\pgfplotspatchvertexy\space}% + \def\b@pgfplotsmeshplothandler@fillpath@default@isfirst{0}% + }% + \pgfpathclose + }, get num cdata vertices=\pgfplotspatchclass{\pgfplotspatchclassname}{get vertices}, set edge visible=\expandafter\edef\csname pgfppatchedge@##1\endcsname{##2}, uses view depth=0, @@ -797,6 +811,12 @@ }% +% A rectangle specified in the sequence +% D <-- C +% | ^ +% v | +% A --> B +% \pgfplotsdeclarepatchclass{rectangle}{% allow matrix=1, new=\def\pgfplotspatchclass@rect@no{0}, diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex index 7506cabcf16..724f1546e22 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex @@ -53,6 +53,10 @@ % \pgfplotsplothandlerserializestateto % \pgfplotsplothandlerdeserializepointfrom % +% in addition, there are utility macros +% \pgfplotsplothandlersurveydifflen#1#2 +% \pgfplotsplothandlersurveypointattime#1#2#3 +% % The idea is as follows: % During \addplot, PGFPLots performs a survey phase. Survey means: % nothing will be drawn, only stats will be collected. In this phase, @@ -261,6 +265,7 @@ % else % pgfplots calls \pgfplotsaxisvisphasetransformcoordinate % pgfplots calls \pgfplotsaxisvisphasepreparedatapoint +% pgfplots calls either \pgfplotsqpointxyz or \pgfplotsqpointxy % fi % \pgfplotstreampoint % } @@ -275,6 +280,10 @@ % Use this only if there *is* point meta, see % \pgfplotsaxisifhaspointmeta{<true code>}{<false code>}. % +% - \pgfplotsaxisvisphasegetpoint +% does not take arguments. It takes the current point as input and +% sets \pgf@x, \pgf@y to the final result. +% % 4. API Functions of pgfplots to work with the visualization phases % % \pgfplotsifissurveyphase{<true code>}{<false code>} @@ -293,6 +302,19 @@ \def\pgfplotssurveyphaseinputclass{direct} +\def\pgfplotsplothandlers@init{% + \def\pgfplotsplothandlers@init@##1{% + \expandafter\def\expandafter##1\expandafter{% + ##1% + \let\pgfplotsplothandlersurveydifflen=\pgfplotsplothandlersurveydifflen@snaptonearest + \let\pgfplotsplothandlersurveypointattime=\pgfplotsplothandlersurveypointattime@snaptonearest + }% + }% + \pgfplotsutilforeachcommasep{\pgfplothandlerdiscard,\pgfplothandlerxbar,\pgfplothandlerybar,\pgfplothandlerxbarinterval,\pgfplothandlerybarinterval}\as\pgfplots@loc@TMPa{% + \expandafter\pgfplotsplothandlers@init@\expandafter{\pgfplots@loc@TMPa}% + }% +}% + % Resets the plot handler routines. % % This is necessary before installing a new plot handler! @@ -301,12 +323,16 @@ \let\pgfplotsplothandlername=\pgfplotsplothandlername@default \let\pgfplotsplothandlersurveyend=\pgfplotsplothandlersurveyend@default \let\pgfplotsplothandlersurveypoint=\pgfplotsplothandlersurveypoint@default + \let\pgfplotsplothandlerpointtokeys=\pgfplotsplothandlerpointtokeys@default \let\pgfplotsplothandlerserializepointto=\pgfplotsplothandlerserializepointto@default \let\pgfplotsplothandlerdeserializepointfrom=\pgfplotsplothandlerdeserializepointfrom@default \let\pgfplotsplothandlerserializestateto=\pgfplotsplothandlerserializestateto@default \let\pgfplotsplothandlerdeserializestatefrom=\pgfplotsplothandlerdeserializestatefrom@default \let\pgfplotsplothandlervisualizejump=\pgfplotsplothandlervisualizejump@default \let\pgfplotsplothandlernotifyscanlinecomplete=\relax + \let\pgfplotsplothandlersurveydifflen=\pgfplotsplothandlersurveydifflen@default + \let\pgfplotsplothandlersurveypointattime=\pgfplotsplothandlersurveypointattime@default + \let\pgfplotsplothandlertransformslopedattime=\pgfplotsplothandlertransformslopedattime@default }% % \pgfplotsplothandlersurveystart @@ -370,14 +396,33 @@ \edef#1{\pgfplots@current@point@x,\pgfplots@current@point@y,\pgfplots@current@point@z}% }% +% \pgfplotsplothandlerdeserializepointfrom{<\macro>} % the counterpart for \pgfplotsplothandlerserializepointto. -% It should restore the state as it was before the serialization. +% It restores the state as it was before the serialization. % % #1: the serialized information. \def\pgfplotsplothandlerdeserializepointfrom@default#1{% \expandafter\pgfplotsplothandlerdeserializepointfrom@default@#1\relax }% +% \pgfplotsplothandlerpointtokeys{<key prefix>} +% +% Takes the current point and copies its values to a set of keys. +% +% For example, if the current point has the three coordinates x=1, +% y=2, z=3, +% \pgfplotsplothandlerpointtokeys{/data point/first/} +% will define the keys +% /data point/first/x/.initial=1 +% /data point/first/y/.initial=2 +% /data point/first/z/.initial=3 +% +\def\pgfplotsplothandlerpointtokeys@default#1{% + \pgfkeyslet{#1/x}\pgfplots@current@point@x + \pgfkeyslet{#1/y}\pgfplots@current@point@y + \pgfkeyslet{#1/z}\pgfplots@current@point@z +}% + \def\pgfplotsplothandlerdeserializepointfrom@default@#1,#2,#3\relax{% \def\pgfplots@current@point@x{#1}% \def\pgfplots@current@point@y{#2}% @@ -406,8 +451,157 @@ \pgfplotstreamstart }% +% \pgfplotsplothandlersurveypointattime#1#2#3 +% +% sets the current environment to a point which is between points #2 +% and #3, using the fraction #1. +% +% #1 a fraction (a number between 0 and 1) in the format of +% \pgfplotscoordmath{default} +% #2 a serialized point denoting the start +% #3 a serialized point denoting the end +% +% In other words: #1 = 0.0 should result in #2 and #1 = 1.0 should +% result in #3. +% +% POSTCONDITION: the current point will be set to the point +% in-between. The current point is set in terms of logical coordinates +% (i.e. \pgfplots@current@point@x and its variants) +\def\pgfplotsplothandlersurveypointattime@default#1#2#3{% + \begingroup + \pgfplotsplothandlerdeserializepointfrom{#2}% + \let\pgfplots@last@x=\pgfplots@current@point@x + \let\pgfplots@last@y=\pgfplots@current@point@y + \let\pgfplots@last@z=\pgfplots@current@point@z + \pgfplotsplothandlerdeserializepointfrom{#3}% + % + \def\pgfplots@loc@TMPa##1{% + \pgfplotscoordmath{##1}{op}{subtract}{{\csname pgfplots@current@point@##1\endcsname}{\csname pgfplots@last@##1\endcsname}}% + \let\pgfplots@diff=\pgfmathresult + \pgfplotscoordmath{##1}{parsenumber}{#1}% + \pgfplotscoordmath{##1}{op}{multiply}{{\pgfmathresult}{\pgfplots@diff}}% + \pgfplotscoordmath{##1}{op}{add}{{\csname pgfplots@last@##1\endcsname}{\pgfmathresult}}% + \expandafter\let\csname pgfplots@current@point@##1\endcsname=\pgfmathresult + }% + \pgfplots@loc@TMPa x% + \pgfplots@loc@TMPa y% + \ifpgfplots@curplot@threedim + \pgfplots@loc@TMPa z% + \fi + \xdef\pgfplots@glob@TMPb{% + \noexpand\def\noexpand\pgfplots@current@point@x{\pgfplots@current@point@x}% + \noexpand\def\noexpand\pgfplots@current@point@y{\pgfplots@current@point@y}% + \noexpand\def\noexpand\pgfplots@current@point@z{\pgfplots@current@point@z}% + }% + \endgroup + \pgfplots@glob@TMPb +}% + +% \pgfplotsplothandlersurveydifflen#1#2 +% +% computes the length between two points which are given in logical +% coordinates. +% #1 a serialized point +% #2 a serialized point +% +% The return value is assigned to \pgfmathresult in +% \pgfplotscoordmath{default} format. +\def\pgfplotsplothandlersurveydifflen@default#1#2{% + \begingroup + \pgfplotsplothandlerdeserializepointfrom{#1}% + \let\pgfplots@last@x=\pgfplots@current@point@x + \let\pgfplots@last@y=\pgfplots@current@point@y + \let\pgfplots@last@z=\pgfplots@current@point@z + \pgfplotsplothandlerdeserializepointfrom{#2}% + \pgfplotscoordmathparsemacro{default}\pgfplots@last@x + \pgfplotscoordmathparsemacro{default}\pgfplots@last@y + \pgfplotscoordmathparsemacro{default}\pgfplots@current@point@x + \pgfplotscoordmathparsemacro{default}\pgfplots@current@point@y + \ifpgfplots@curplot@threedim + \pgfplotscoordmathparsemacro{default}\pgfplots@last@z + \pgfplotscoordmathparsemacro{default}\pgfplots@current@point@z + \fi + \pgfplotscoordmath{default}{op}{subtract}{{\pgfplots@current@point@x}{\pgfplots@last@x}}% + \pgfplotscoordmath{default}{op}{multiply}{{\pgfmathresult}{\pgfmathresult}}% + \let\pgfplots@diff@x=\pgfmathresult + \pgfplotscoordmath{default}{op}{subtract}{{\pgfplots@current@point@y}{\pgfplots@last@y}}% + \pgfplotscoordmath{default}{op}{multiply}{{\pgfmathresult}{\pgfmathresult}}% + \let\pgfplots@diff@y=\pgfmathresult + \pgfplotscoordmath{default}{op}{add}{{\pgfplots@diff@x}{\pgfplots@diff@y}}% + \let\pgfplots@len=\pgfmathresult + \ifpgfplots@curplot@threedim + \pgfplotscoordmath{default}{op}{subtract}{{\pgfplots@current@point@z}{\pgfplots@last@z}}% + \pgfplotscoordmath{default}{op}{multiply}{{\pgfmathresult}{\pgfmathresult}}% + \let\pgfplots@diff@z=\pgfmathresult + \pgfplotscoordmath{default}{op}{add}{{\pgfplots@len}{\pgfplots@diff@z}}% + \let\pgfplots@len=\pgfmathresult + \fi + \pgfplotscoordmath{default}{op}{sqrt}{{\pgfplots@len}}% + \pgfmath@smuggleone\pgfmathresult + \endgroup +}% + +% \pgfplotsplothandlertransformslopedattime{<time fraction>}{<start>}{<end>} +% +% Installs a PGF rotation matrix such that it fits the gradient of the +% current plot segment between <start> and <end>. +% +% #1: a fraction such that 0.0 is <start> and 1.0 is <end> +% #2: the <start> point (a macro containing the result of \pgfplotsplothandlerserializepointto) +% #3: the <end> point (a macro containing the result of \pgfplotsplothandlerserializepointto) +% +\def\pgfplotsplothandlertransformslopedattime@default#1#2#3{% + \pgf@process{% + \pgfplotsplothandlerdeserializepointfrom{#2}% + \pgfplotsaxisvisphasegetpoint + }% + \pgf@xa=\pgf@x% xb/yb = start point + \pgf@ya=\pgf@y% + \pgf@process{% + \pgfplotsplothandlerdeserializepointfrom{#3}% + \pgfplotsaxisvisphasegetpoint + }% + \advance\pgf@x by-\pgf@xa% + \advance\pgf@y by-\pgf@ya% + \ifpgfallowupsidedownattime% + \else% + \ifdim\pgf@x<0pt% + \pgf@x=-\pgf@x% + \pgf@y=-\pgf@y% + \fi% + \fi% + \pgfpointnormalised{}% x/y = normalised vector + \pgf@ya=-\pgf@y% + \pgftransformcm% + {\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}% + {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}{\pgfpointorigin}% +}% + + + \pgfplotsresetplothandler +% The following two methods constitutes implementations for +% 'node[pos=<faction>]' which do not interpolate. They only snap to +% the nearest coordinate. +% +% For example, \addplot[scatter] ... node[pos=0.5] {} should use a +% unit distance and should not interpolate between scatter points. +\def\pgfplotsplothandlersurveydifflen@snaptonearest#1#2{% + % FIXME : this implies that #1 and #2 are "adjacent" in the + % coordinate stream! + \pgfplotscoordmath{default}{one}% +}% +\def\pgfplotsplothandlersurveypointattime@snaptonearest#1#2#3{% + \pgfplotscoordmath{default}{parsenumber}{0.5}% + \let\pgfplots@loc@TMPa=\pgfmathresult + \pgfplotscoordmath{default}{parsenumber}{#1}% + \pgfplotscoordmath{default}{if less than}{\pgfmathresult}{\pgfplots@loc@TMPa}{% + \pgfplotsplothandlerdeserializepointfrom{#2}% + }{% + \pgfplotsplothandlerdeserializepointfrom{#3}% + }% +}% % ================================== % Defines @@ -1011,6 +1205,7 @@ \let\pgfplotsplothandlersurveypoint=\pgfplotsplothandlersurveypoint@quiver \let\pgfplotsplothandlerserializepointto=\pgfplotsplothandlerserializepointto@quiver \let\pgfplotsplothandlerdeserializepointfrom=\pgfplotsplothandlerdeserializepointfrom@quiver + \let\pgfplotsplothandlerpointtokeys=\pgfplotsplothandlerpointtokeys@quiver \let\pgfplotsplothandlerquiver@vis@hook=\pgfutil@empty % \ifpgfplots@xislinear \else \pgfplotsplothandlerquivererror \fi @@ -1096,6 +1291,12 @@ \def\pgfplots@quiver@v{#5}% \def\pgfplots@quiver@w{#6}% }% +\def\pgfplotsplothandlerpointtokeys@quiver#1{% + \pgfplotsplothandlerpointtokeys@default + \pgfkeyslet{#1/u}\pgfplots@quiver@u + \pgfkeyslet{#1/v}\pgfplots@quiver@v + \pgfkeyslet{#1/w}\pgfplots@quiver@w +}% \def\pgfplotsplothandlervisbegin@quiver{% \def\pgfplots@quiver@has@handled@point@meta{0}% \pgfkeysgetvalue{/pgfplots/quiver/arrow color}\pgfplots@quiver@color @@ -1461,6 +1662,9 @@ contour/labels=true, contour/filled/.is if=pgfplotsplothandlercontour@filled, contour/filled/.default=true, + % EXPERIMENTAL: WILL CHANGE EVENTUALLY! + % this is (only) used for contour filled: + % data limits={(xmin,ymin,zmin,cmin) (xmax,ymax,ymax,cmax} contour/data limits/.initial=,% FIXME EXPERIMENTAL contour/every contour label/.style={% sloped,% @@ -1558,6 +1762,8 @@ \def\pgfplotsplothandlersurveystart@contourmatlabformat{% \def\c@pgfplotsplothandlercontourprepared@matlabformat@cur{0}% \def\c@pgfplotsplothandlercontourprepared@matlabformat@count{0}% + \pgfmathfloatparsenumber{nan}% + \let\pgfplotsplothandlercontourprepared@matlabformat@meta=\pgfmathresult } \def\pgfplotsplothandlersurveypoint@contourmatlabformat{% \ifnum\c@pgfplotsplothandlercontourprepared@matlabformat@cur=\c@pgfplotsplothandlercontourprepared@matlabformat@count\relax @@ -1567,8 +1773,15 @@ \def\c@pgfplotsplothandlercontourprepared@matlabformat@cur{0}% % \pgfmathfloatparsenumber{\pgfplots@current@point@x}% + \let\pgfplots@loc@TMPa=\pgfplotsplothandlercontourprepared@matlabformat@meta \let\pgfplotsplothandlercontourprepared@matlabformat@meta=\pgfmathresult % + \ifx\pgfplots@loc@TMPa\pgfplotsplothandlercontourprepared@matlabformat@meta + % oh. We have two successive segments of the SAME contour + % level. Call the jump handler: + \pgfplotsscanlinecomplete + \fi + % \else \let\pgfplots@current@point@z=\pgfplotsplothandlercontourprepared@matlabformat@meta \let\pgfplots@current@point@meta=\pgfplotsplothandlercontourprepared@matlabformat@meta @@ -1599,6 +1812,7 @@ % \ifpgfplotsplothandlercontour@filled \pgfseteorule + \let\pgfplotsplothandlercontour@sequence@sort@cmp=\pgfutil@empty \pgfplotsapplistXnewempty\pgfplotsplothandlercontour@stored@lastcontourpath \pgfplotsplothandlercontour@init@limits \fi @@ -1817,18 +2031,58 @@ \fi }% - +% #1: the transformed point meta of the last contour. +\def\pgfplotsplothandlercontour@filled@assert@is@sorted#1{% + \ifx\pgfplotsplothandlercontour@lastcontour\pgfutil@empty + \else + \ifx\pgfplotsplothandlercontour@sequence@sort@cmp\pgfutil@empty + % we need to determine the sorting: + \pgfplotscoordmath{float}{if less than}{\pgfplotsplothandlercontour@lastcontour}{\pgfplots@current@point@meta}{% + \def\pgfplotsplothandlercontour@sequence@sort@cmp{+}% + }{% + \pgfplotscoordmath{float}{if less than}{\pgfplots@current@point@meta}{\pgfplotsplothandlercontour@lastcontour}{% + \def\pgfplotsplothandlercontour@sequence@sort@cmp{-}% + }{% + % undecided - the contours have the same label. + }% + }% + \else + \if +\pgfplotsplothandlercontour@sequence@sort@cmp + \pgfplotscoordmath{float}{if less than}{\pgfplots@current@point@meta}{\pgfplotsplothandlercontour@lastcontour}{% + \pgfplotsplothandlercontour@filled@assert@is@sorted@fail{ASCENDING}% + }{% + }% + \else + \pgfplotscoordmath{float}{if less than}{\pgfplotsplothandlercontour@lastcontour}{\pgfplots@current@point@meta}{% + \pgfplotsplothandlercontour@filled@assert@is@sorted@fail{DESCENDING}% + }{% + }% + \fi + \fi + \fi +}% +\def\pgfplotsplothandlercontour@filled@assert@is@sorted@fail#1{% + \begingroup + \pgfplotscoordmath{float}{tostring}{\pgfplots@current@point@meta}% + \let\offending=\pgfmathresult + \pgfplotscoordmath{float}{tostring}{\pgfplotsplothandlercontour@lastcontour}% + \let\lastcontour=\pgfmathresult + \pgfplots@error{Sorry, filled contours implicitly assume that the contour levels are SORTED (in the given case, they appear to be sorted in #1 order). Please make sure your input data has sorted contour levels. The offending level is \offending; the previous contour level is \lastcontour}% + \endgroup +} \def\pgfplotsplothandlercontour@preparenewcontourline{% \if0\pgfplotsplothandlercontour@haspendingjump %\message{PREPARE NEW CONTOUR LEVEL (\pgfplots@current@point@meta).}% % a completely new level has been % started, not due to jumps inside of one level. % + \let\pgfplotspointmetatransformed@lastcontour=\pgfplotspointmetatransformed % thus, we need to compute 'mapped color': \pgfplotsaxisvisphasetransformpointmeta \pgfplotscolormapdefinemappedcolor{\pgfplotspointmetatransformed}% \pgfsetstrokecolor{\pgfkeysvalueof{/pgfplots/contour/draw color}}% \ifpgfplotsplothandlercontour@filled + \pgfplotsplothandlercontour@filled@assert@is@sorted{\pgfplotspointmetatransformed@lastcontour}% \pgfsetfillcolor{\pgfkeysvalueof{/pgfplots/contour/fill color}}% \fi % diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex index 2276f571db9..15e78f6c8fd 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex @@ -119,15 +119,17 @@ \def\pgfplots@stacked@zerolevelpoint@y{0}% \def\pgfplots@stacked@zerolevelpoint@z{0}% \else - \pgfplotscoordmath{x}{parsenumber}{0}% + % note that log plots are special: their "stacked zero" is + % computed with \pgfplotscoordmath{default} + % + \pgfplots@if{pgfplots@xislinear}{\pgfplotscoordmath{x}{zero}}{\pgfplotscoordmath{default}{zero}}% \let\pgfplots@stacked@zerolevelpoint@x=\pgfmathresult + % + \pgfplots@if{pgfplots@yislinear}{\pgfplotscoordmath{y}{zero}}{\pgfplotscoordmath{default}{zero}}% \let\pgfplots@stacked@zerolevelpoint@y=\pgfmathresult - \let\pgfplots@stacked@zerolevelpoint@z=\pgfmathresult % - \pgfmathfloatcreate{0}{0.0}{0}% - \ifpgfplots@xislinear\else \let\pgfplots@stacked@zerolevelpoint@x=\pgfmathresult \fi - \ifpgfplots@yislinear\else \let\pgfplots@stacked@zerolevelpoint@y=\pgfmathresult \fi - \ifpgfplots@zislinear\else \let\pgfplots@stacked@zerolevelpoint@z=\pgfmathresult \fi + \pgfplots@if{pgfplots@xislinear}{\pgfplotscoordmath{z}{zero}}{\pgfplotscoordmath{default}{zero}}% + \let\pgfplots@stacked@zerolevelpoint@z=\pgfmathresult \fi % \def\pgfplots@stacked@getnextzerolevelpoint{}% will remain constant anyway. @@ -264,12 +266,13 @@ {\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}}% }{% % LOG. we need to compute log(zerolevel + current): - \pgfplotscoordmath{\pgfplots@stacked@dir}{exp}{\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}% - \pgfmathfloatparsenumber\pgfmathresult + \pgfplotscoordmath{default}{parsenumber}{\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}% + \pgfplotscoordmath{default}{exp}{\pgfmathresult}% \expandafter\let\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname=\pgfmathresult - \csname pgfmathfloat\pgfplots@stacked@op @\endcsname + \pgfplotscoordmath{default}{op}{\pgfplots@stacked@op}{% {\csname pgfplots@stacked@zerolevelpoint@\pgfplots@stacked@dir\endcsname}% {\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}% + }% }% % % for logs, I remember just zerolevel+current; not its log. diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex index de218f8bcb9..c2a06a6b44c 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex @@ -507,13 +507,8 @@ \fi }{}% \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 + \pgfplots@coord@inv@trafo@apply{#1}{\tick}% + \let\tick=\pgfmathresult }% \def\pgfplots@user@ticklabel@list@x{% |