diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex | 335 |
1 files changed, 317 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex index bbf7d10db86..d088694c992 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex @@ -25,7 +25,9 @@ %-------------------------------------------- \edef\pgfplots@oldcatcodesemicolon{\the\catcode`\;}% +\edef\pgfplots@oldcatcodedoublequote{\the\catcode`\"}% \catcode`\;=12 +\catcode`\"=12 \input pgfplotscore.code.tex \input pgfplotslibrary.code.tex @@ -132,6 +134,7 @@ \newif\ifpgfplotsplothandlermesh@hide@refined@edges \newif\ifpgfplots@has@cell@picture \newif\ifpgfplots@substitute@pgfpoint +\newif\ifpgfplots@LUA@backend@supported \newif\ifpgfplots@collect@firstplot@astick \newif\ifpgfplots@units@use @@ -515,6 +518,10 @@ }% } +\newif\ifpgfplots@LUA@fail@on@TeX@fallback +\def\pgfplots@LUA@loglevel@info{4} +\def\pgfplots@LUA@loglevel@debug{5} + \pgfkeys{% /pgfplots/search path for tikz/.search also={/tikz,/pgfplots}, /pgfplots/.is family, @@ -594,6 +601,38 @@ /pgfplots/on layer/.initial=, % mark layer can be 'auto', 'like plot', or a layer name. /pgfplots/mark layer/.initial=, + /pgfplots/lua backend/.is if=pgfplots@LUA@backend@supported, + /pgfplots/lua backend/.default=true, + % + /pgfplots/lua debug/.is choice, + /pgfplots/lua debug/false/.style={/pgfplots/lua debug/off},% + /pgfplots/lua debug/off/.code={% + \def\pgfplots@LUA@backend@debugmode{off}% + \def\pgfplots@LUA@loglevel@debug{5}% + \def\pgfplots@LUA@loglevel@info{4}% + \pgfplots@LUA@fail@on@TeX@fallbackfalse + }, + /pgfplots/lua debug/off and silent/.code={% + \def\pgfplots@LUA@backend@debugmode{off and silent}% + \def\pgfplots@LUA@loglevel@debug{5}% + \def\pgfplots@LUA@loglevel@info{5}% + \pgfplots@LUA@fail@on@TeX@fallbackfalse + }, + % + /pgfplots/lua debug/verbose/.code={% + \def\pgfplots@LUA@backend@debugmode{verbose}% + \def\pgfplots@LUA@loglevel@debug{4}% + \def\pgfplots@LUA@loglevel@info{4}% + \pgfplots@LUA@fail@on@TeX@fallbackfalse + }, + /pgfplots/lua debug/compileerror/.code={% + \def\pgfplots@LUA@backend@debugmode{compileerror}% + \def\pgfplots@LUA@loglevel@debug{4}% + \def\pgfplots@LUA@loglevel@info{4}% + \pgfplots@LUA@fail@on@TeX@fallbacktrue + }, + /pgfplots/lua debug/.default=verbose, + /pgfplots/lua debug=off, /pgfplots/every axis/.style={}, /pgfplots/every axis/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis}}, /pgfplots/every axis/.belongs to family=/pgfplots/style commands, @@ -877,6 +916,8 @@ xticklabel=, ytick=, yticklabel=, + zmin=, + zmax=, }, /pgfplots/colorbar right/.style={% /pgfplots/colorbar=true, @@ -1030,8 +1071,9 @@ domain=\pgfkeysvalueof{/pgfplots/point meta min}:\pgfkeysvalueof{/pgfplots/point meta max}, samples y=2, domain y=0:1, + every colorbar, zmin=0,zmax=1, - every colorbar,colorbar shift,colorbar=false] + colorbar shift,colorbar=false] \pgfkeysvalueof{/pgfplots/colorbar addplot}% \endaxis },% @@ -1798,6 +1840,9 @@ /pgfplots/z filter/.code={}, /pgfplots/z filter/.belongs to family=/pgfplots, /pgfplots/filter point/.code=, + /pgfplots/x filter/.expression/.code=\pgfplots@install@filter@expression{x filter}{#1}, + /pgfplots/y filter/.expression/.code=\pgfplots@install@filter@expression{y filter}{#1}, + /pgfplots/z filter/.expression/.code=\pgfplots@install@filter@expression{z filter}{#1}, /pgfplots/restrict x to domain/.style={/pgfplots/@restrict to domain={x}{}{#1}{0}},% /pgfplots/restrict y to domain/.style={/pgfplots/@restrict to domain={y}{}{#1}{0}},% /pgfplots/restrict z to domain/.style={/pgfplots/@restrict to domain={z}{}{#1}{0}},% @@ -3454,7 +3499,7 @@ /pgfplots/point meta/TeX code/.value required, /pgfplots/point meta/TeX code symbolic/.code={\pgfplotssetpointmetainput{TeX code symbolic}{#1}},% /pgfplots/point meta/TeX code symbolic/.value required, - /pgfplots/point meta/symbolic/.style={/pgfplots/point meta/TeX code symbolic={\def\pgfplotspointmeta{#1}}}, + /pgfplots/point meta/symbolic/.style={/pgfplots/point meta/TeX code symbolic={\edef\pgfplotspointmeta{#1}}}, /pgfplots/set point meta if empty/.code={% \ifx\pgfplotspointmetainputhandler\pgfutil@empty \pgfkeysalso{/pgfplots/point meta=#1}% @@ -3693,6 +3738,7 @@ /pgfplots/compat/anchors/1.9/.style= {/pgfplots/compat/anchors/1.3},% /pgfplots/compat/anchors/1.10/.style= {/pgfplots/compat/anchors/1.3},% /pgfplots/compat/anchors/1.11/.style= {/pgfplots/compat/anchors/1.3},% + /pgfplots/compat/anchors/1.12/.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},% % @@ -3708,6 +3754,7 @@ /pgfplots/compat/empty line/1.9/.style= {/pgfplots/compat/empty line/1.4},% /pgfplots/compat/empty line/1.10/.style= {/pgfplots/compat/empty line/1.4},% /pgfplots/compat/empty line/1.11/.style= {/pgfplots/compat/empty line/1.4},% + /pgfplots/compat/empty line/1.12/.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},% % @@ -3723,6 +3770,7 @@ /pgfplots/compat/path replacement/1.9/.style= {/pgfplots/compat/path replacement/1.5.1}, /pgfplots/compat/path replacement/1.10/.style= {/pgfplots/compat/path replacement/1.5.1}, /pgfplots/compat/path replacement/1.11/.style= {/pgfplots/compat/path replacement/1.5.1}, + /pgfplots/compat/path replacement/1.12/.style= {/pgfplots/compat/path replacement/1.5.1}, /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},% % @@ -3738,6 +3786,7 @@ /pgfplots/compat/pgfpoint substitution/1.9/.style= {/pgfplots/compat/pgfpoint substitution/pre 1.3}, /pgfplots/compat/pgfpoint substitution/1.10/.style= {/pgfplots/compat/pgfpoint substitution/pre 1.3}, /pgfplots/compat/pgfpoint substitution/1.11/.code= {\pgfplots@substitute@pgfpointtrue}, + /pgfplots/compat/pgfpoint substitution/1.12/.style= {/pgfplots/compat/pgfpoint substitution/1.11}, /pgfplots/compat/pgfpoint substitution/newest/.style= {/pgfplots/compat/pgfpoint substitution/1.11},% /pgfplots/compat/pgfpoint substitution/default/.style= {/pgfplots/compat/pgfpoint substitution/pre 1.3},% %ellipse/.is if=pgfplots@path@replace@ellipse, @@ -3763,6 +3812,7 @@ /pgfplots/compat/labels/1.9/.style= {/pgfplots/compat/labels/1.8},% /pgfplots/compat/labels/1.10/.style= {/pgfplots/compat/labels/1.8},% /pgfplots/compat/labels/1.11/.style= {/pgfplots/compat/labels/1.8},% + /pgfplots/compat/labels/1.12/.style= {/pgfplots/compat/labels/1.8},% /pgfplots/compat/labels/newest/.style= {/pgfplots/compat/labels/1.8},% /pgfplots/compat/labels/default/.style= {/pgfplots/compat/labels/pre 1.3},% maintain backwards compatibility % @@ -3802,6 +3852,7 @@ },% /pgfplots/compat/bar nodes/1.10/.style= {/pgfplots/compat/bar nodes/1.9},% /pgfplots/compat/bar nodes/1.11/.style= {/pgfplots/compat/bar nodes/1.9},% + /pgfplots/compat/bar nodes/1.12/.style= {/pgfplots/compat/bar nodes/1.9},% /pgfplots/compat/bar nodes/newest/.style= {/pgfplots/compat/bar nodes/1.9},% /pgfplots/compat/bar nodes/default/.style= {/pgfplots/compat/bar nodes/pre 1.3},% maintain backwards compatibility /pgfplots/compat/bar nodes/default, @@ -3832,6 +3883,7 @@ /pgfplots/compat/scaling/1.9/.style={/pgfplots/compat/scaling/1.6}, /pgfplots/compat/scaling/1.10/.style={/pgfplots/compat/scaling/1.6}, /pgfplots/compat/scaling/1.11/.style={/pgfplots/compat/scaling/1.6}, + /pgfplots/compat/scaling/1.12/.style={/pgfplots/compat/scaling/1.6}, /pgfplots/compat/scaling/newest/.style={/pgfplots/compat/scaling/1.6}, /pgfplots/compat/scaling/default/.style={/pgfplots/compat/scaling/1.4}, % @@ -3847,6 +3899,7 @@ /pgfplots/compat/scale mode/1.9/.style={/pgfplots/compat/scale mode/1.6}, /pgfplots/compat/scale mode/1.10/.style={/pgfplots/compat/scale mode/1.6}, /pgfplots/compat/scale mode/1.11/.style={/pgfplots/compat/scale mode/1.6}, + /pgfplots/compat/scale mode/1.12/.style={/pgfplots/compat/scale mode/1.6}, /pgfplots/compat/scale mode/newest/.style={/pgfplots/compat/scale mode/1.6}, /pgfplots/compat/scale mode/default/.style={/pgfplots/compat/scale mode/1.5}, % @@ -3863,6 +3916,7 @@ /pgfplots/compat/plot3graphics/1.9/.style= {/pgfplots/compat/plot3graphics/1.6},% /pgfplots/compat/plot3graphics/1.10/.style= {/pgfplots/compat/plot3graphics/1.6},% /pgfplots/compat/plot3graphics/1.11/.style= {/pgfplots/compat/plot3graphics/1.6},% + /pgfplots/compat/plot3graphics/1.12/.style= {/pgfplots/compat/plot3graphics/1.6},% /pgfplots/compat/plot3graphics/newest/.style= {/pgfplots/compat/plot3graphics/1.6},% /pgfplots/compat/plot3graphics/default/.style= {/pgfplots/compat/plot3graphics/1.5},% % @@ -3905,6 +3959,7 @@ /pgfplots/compat/bar width by units/1.9/.style= {/pgfplots/compat/bar width by units/1.7}, /pgfplots/compat/bar width by units/1.10/.style= {/pgfplots/compat/bar width by units/1.7}, /pgfplots/compat/bar width by units/1.11/.style= {/pgfplots/compat/bar width by units/1.7}, + /pgfplots/compat/bar width by units/1.12/.style= {/pgfplots/compat/bar width by units/1.7}, /pgfplots/compat/bar width by units/newest/.style= {/pgfplots/compat/bar width by units/1.7}, /pgfplots/compat/bar width by units/default/.style={/pgfplots/compat/bar width by units/pre 1.3}, % @@ -3920,22 +3975,40 @@ /pgfplots/compat/BB/1.9/.style= {/pgfplots/compat/BB/1.8},% /pgfplots/compat/BB/1.10/.style= {/pgfplots/compat/BB/1.8},% /pgfplots/compat/BB/1.11/.style= {/pgfplots/compat/BB/1.8},% + /pgfplots/compat/BB/1.12/.style= {/pgfplots/compat/BB/1.8},% /pgfplots/compat/BB/newest/.style= {/pgfplots/compat/BB/1.8}, /pgfplots/compat/BB/default/.style={/pgfplots/compat/BB/pre 1.3}, % /pgfplots/compat/general/.is choice, - /pgfplots/compat/general/pre 1.3/.style={/pgfplots/log origin=infty,/pgfplots/enable tick line clipping=true},% + /pgfplots/compat/general/pre 1.3/.style={ + /pgfplots/log origin=infty, + /pgfplots/enable tick line clipping=true, + /pgfplots/lua backend=false, + /pgfplots/compat/library hook={statistics}{/pgfplots/boxplot/estimator=legacy,/pgfplots/boxplot/ensure mark=false}, + },% /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/log origin=0,/pgfplots/enable tick line clipping=true},% + /pgfplots/compat/general/1.5/.style= { + /pgfplots/compat/general/pre 1.3, + /pgfplots/log origin=0, + /pgfplots/enable tick line clipping=true, + },% /pgfplots/compat/general/1.5.1/.style= {/pgfplots/compat/general/1.5},% /pgfplots/compat/general/1.6/.style= {/pgfplots/compat/general/1.5},% /pgfplots/compat/general/1.7/.style= {/pgfplots/compat/general/1.5},% /pgfplots/compat/general/1.8/.style= {/pgfplots/compat/general/1.5},% /pgfplots/compat/general/1.9/.style= {/pgfplots/compat/general/1.5},% /pgfplots/compat/general/1.10/.style= {/pgfplots/compat/general/1.5},% - /pgfplots/compat/general/1.11/.style= {/pgfplots/compat/general/1.5,/pgfplots/enable tick line clipping=false},% - /pgfplots/compat/general/newest/.style= {/pgfplots/compat/general/1.11}, + /pgfplots/compat/general/1.11/.style= { + /pgfplots/compat/general/1.5, + /pgfplots/enable tick line clipping=false, + },% + /pgfplots/compat/general/1.12/.style= { + /pgfplots/compat/general/1.11, + /pgfplots/lua backend, + /pgfplots/compat/library hook={statistics}{/pgfplots/boxplot/estimator=Excel,/pgfplots/boxplot/ensure mark=true}, + },% + /pgfplots/compat/general/newest/.style= {/pgfplots/compat/general/1.12}, /pgfplots/compat/general/default/.style={/pgfplots/compat/general/1.11}, % /pgfplots/enable tick line clipping/.is if=pgfplots@enable@tick@line@clipping, @@ -3953,7 +4026,7 @@ /pgfplots/compat/show suggested version/.is if=pgfplots@show@suggested@version, /pgfplots/compat/show suggested version=true, /pgfplots/compat/current/.initial=, - /pgfplots/compat/mostrecent/.initial=1.11, + /pgfplots/compat/mostrecent/.initial=1.12, /pgfplots/compat/.style={% % ATTENTION: *every* /pgfplots/compat/ setting needs to accept % the same choices due to this construction: @@ -7871,11 +7944,13 @@ \pgfplots@error{Sorry, 'cell picture=false' is UNSUPPORTED for 'anchor=\pgfplots@anchorname'.}% \fi \if2\pgfplots@cell@picture@mode - \pgfplots@log3{'cell picture=if necessary' resulted in 'cell picture=true'}% + \pgfplots@log5{'cell picture=if necessary' resulted in 'cell picture=true'}% \fi #1\relax }{% - \pgfplots@log3{'cell picture=if necessary' resulted in 'cell picture=false'}% + \if2\pgfplots@cell@picture@mode + \pgfplots@log5{'cell picture=if necessary' resulted in 'cell picture=false'}% + \fi % OK, an a priori anchor is available - we do not really need % a cell picture and this is compatible with the input % options: @@ -9636,6 +9711,9 @@ \pgfkeyssetfamily{/tikz/overlay}{/pgfplots/shared with tikz}% \pgfkeyssetfamily{/tikz/variable}{/pgfplots}% % + \pgfkeysdef{/pgfplots/declare function}{\pgfkeysalso{/pgf/declare function={##1}}}% + \pgfkeyssetfamily{/pgf/declare function}{/pgfplots}% + % % ... we need to set these options during the survey phase % (because it might be interesting for enlarge limits to depend % upon their value): @@ -10314,6 +10392,61 @@ }% }% +% Callback if the LUA backend does not support a sub-operation. The +% reason will be logged. +\def\pgfplots@LUA@backend@failed{% + \ifpgfplots@LUA@fail@on@TeX@fallback + \pgfplots@error{lua backend has been deactivated since some input option is unsupported and 'lua debug=compileerror' is active. Please see the most recent message in your .log file for details}% + \fi +}% + +\def\pgfplots@LUA@visualizationlog@deactivation#1{% + \pgfplots@log{\pgfplots@LUA@loglevel@info}{Using 'lua backend=false' for axis: #1.}% + \pgfplots@LUA@backend@failed +}% +\def\pgfplots@prepare@LUA@api{% + \ifpgfplots@LUA@backend@supported + \ifpgfplots@LUA@supported + \else + \pgfplots@LUA@backend@supportedfalse + \fi + % + \ifpgfplots@stackedmode + \pgfplots@LUA@visualizationlog@deactivation{stacked plots unsupported (yet)}% + \pgfplots@LUA@backend@supportedfalse + \fi + % + \ifpgfplots@xislinear\else \pgfplots@LUA@backend@supportedfalse\pgfplots@LUA@visualizationlog@deactivation{xmode=log unsupported (yet)}\fi + \ifpgfplots@yislinear\else \pgfplots@LUA@backend@supportedfalse\pgfplots@LUA@visualizationlog@deactivation{ymode=log unsupported (yet)}\fi + \ifpgfplots@zislinear\else \pgfplots@LUA@backend@supportedfalse\pgfplots@LUA@visualizationlog@deactivation{zmode=log unsupported (yet)}\fi + % + \pgfkeysgetvalue{/pgfplots/x coord trafo/.@cmd}\pgfplots@loc@TMPc\ifx\pgfplots@loc@TMPc\pgfplots@empty@command@key\else \pgfplots@LUA@backend@supportedfalse\pgfplots@LUA@visualizationlog@deactivation{x coord trafo unsupported}\fi + \pgfkeysgetvalue{/pgfplots/y coord trafo/.@cmd}\pgfplots@loc@TMPc\ifx\pgfplots@loc@TMPc\pgfplots@empty@command@key\else \pgfplots@LUA@backend@supportedfalse\pgfplots@LUA@visualizationlog@deactivation{x coord trafo unsupported}\fi + \pgfkeysgetvalue{/pgfplots/z coord trafo/.@cmd}\pgfplots@loc@TMPc\ifx\pgfplots@loc@TMPc\pgfplots@empty@command@key\else \pgfplots@LUA@backend@supportedfalse\pgfplots@LUA@visualizationlog@deactivation{x coord trafo unsupported}\fi + % + % FIXME: collect all remaining items + % + \ifpgfplots@LUA@backend@supported + \pgfplots@log{\pgfplots@LUA@loglevel@debug}{lua backend=true: Activating LUA backend for axis.}% + \directlua{% + pgfplots.gca = pgfplots.Axis.new(); + pgfplots.gca.is3d = \pgfplots@boolval{pgfplots@threedim}; + pgfplots.gca.clipLimits = \pgfplots@boolval{pgfplots@clip@limits}; + pgfplots.gca.autocomputeAllLimits = \pgfplots@boolval{pgfplots@autocompute@all@limits}; + pgfplots.gca.autocomputeMin = { + \pgfplots@boolval{pgfplots@autocompute@xmin}, + \pgfplots@boolval{pgfplots@autocompute@ymin}, + \pgfplots@boolval{pgfplots@autocompute@zmin} }; + pgfplots.gca.autocomputeMax = { + \pgfplots@boolval{pgfplots@autocompute@xmax}, + \pgfplots@boolval{pgfplots@autocompute@ymax}, + \pgfplots@boolval{pgfplots@autocompute@zmax} }; + % attention: min/max is (also) handed over in \pgfplots@LUA@survey@start + }% + \fi + \fi +}% + \long\def\pgfplotsifissurveyphase#1#2{% \if\pgfplots@phase@name s% #1\relax @@ -10623,6 +10756,7 @@ % % defines \pgfplotsaxisupdatelimitsforcoordinate etc. \pgfplots@prepare@axis@API + \pgfplots@prepare@LUA@api \pgfkeysvalueof{/pgfplots/execute at begin axis}% \pgfkeysvalueof{/pgfplots/execute at begin axis@@}% \def\pgfplots@phase@name{s}% @@ -10683,6 +10817,10 @@ % ensure that (1,2) is automatically converted to (axis cs:1,2) : \pgfplots@change@pgfpoints@to@axiscs % + \ifpgfplots@LUA@backend@supported + \pgfplots@LUA@visualization@update@axis + \fi + % % make it ungrouped: we must not destroy group nesting of tikz % path instructions at this point. \pgfplotslistforeachungrouped\pgfplots@stored@plotlist\as\pgfplots@loc@TMPa{% @@ -10760,6 +10898,8 @@ \pgfplots@finally@correct@child@node@positions \pgfplots@stacked@finalize % + \pgfplots@LUA@cleanup + % \ifpgfplots@colorbar \pgfplots@colorbar@move@outside@scope@with@globalmacro{\pgfplots@glob@TMPa}% \else @@ -10798,6 +10938,58 @@ \aftergroup\pgfplots@cell@picture@remembered } +\def\pgfplots@LUA@visualization@update@axis{% + \ifpgfplots@threedim + \pgfplotsmathvectortocomponents\pgfplots@view@dir@threedim{pgfplots@loc@}{default}% + \fi + % + \let\pgfplots@loc@TMPa\pgfutil@empty% + \pgfplotscoordmath{x}{datascaletrafo get params}% + \edef\pgfplots@loc@TMPa{% + \pgfplots@loc@TMPa + local datascaleTrafoX = pgfplots.DatascaleTrafo.new(\pgfplotsretval,\pgfplotsretvalb);^^J + }% + \pgfplotscoordmath{y}{datascaletrafo get params}% + \edef\pgfplots@loc@TMPa{% + \pgfplots@loc@TMPa + local datascaleTrafoY = pgfplots.DatascaleTrafo.new(\pgfplotsretval,\pgfplotsretvalb);^^J + }% + \pgfplotscoordmath{z}{datascaletrafo get params}% + \edef\pgfplots@loc@TMPa{% + \pgfplots@loc@TMPa + local datascaleTrafoZ = pgfplots.DatascaleTrafo.new(\pgfplotsretval,\pgfplotsretvalb);^^J + }% + % + \edef\pgfplots@loc@TMPa{% + \pgfplots@loc@TMPa + local axis = pgfplots.gca;^^J% + % FIXME : what about datamin/max? + axis.axiswidemetamin = pgfplots.pgftonumber("\pgfplots@axiswide@metamin"); ^^J% + axis.axiswidemetamax = pgfplots.pgftonumber("\pgfplots@axiswide@metamax"); ^^J% + axis.datascaleTrafo = { datascaleTrafoX, datascaleTrafoY, datascaleTrafoZ };^^J% + axis:setunitvectors({ % + { \pgf@sys@tonumber\pgf@xx, \pgf@sys@tonumber\pgf@xy }, + { \pgf@sys@tonumber\pgf@yx, \pgf@sys@tonumber\pgf@yy }, + { \pgf@sys@tonumber\pgf@zx, \pgf@sys@tonumber\pgf@zy } });^^J% + \ifpgfplots@threedim + axis.viewdir = { + pgfplots.pgftonumber("\pgfplots@loc@x"), + pgfplots.pgftonumber("\pgfplots@loc@y"), + pgfplots.pgftonumber("\pgfplots@loc@z") };^^J% + \fi + }% +%\message{Executing \pgfplots@loc@TMPa}% + \directlua{\pgfplots@loc@TMPa} +}% + +\def\pgfplots@LUA@cleanup{% + \ifpgfplots@LUA@backend@supported + \directlua{pgfplots.gca=nil}% + \fi +}% + +% +% This is part of \ifpgfplots@substitute@pgfpoint: \def\pgfplots@environment@opt@@setup@pgfpoint@restores{% % There are places in pgfplots where the default coordinate system % (i.e. the one used whenever one writes (1,2)) needs to be @@ -10818,6 +11010,9 @@ \let\pgfsetyvec@orig=\pgfsetyvec \let\pgfsetzvec@orig=\pgfsetzvec \let\tikz@checkunit@orig=\tikz@checkunit + \let\pgfpatharcaxes@orig=\pgfpatharcaxes + \let\pgfpointpolarxy@orig=\pgfpointpolarxy + \let\tikz@do@arc@orig=\tikz@do@arc % \let\pgfsetxvec=\pgfplots@setxvec@restorepgfpoint \let\pgfsetyvec=\pgfplots@setyvec@restorepgfpoint @@ -10830,6 +11025,9 @@ \let\pgfpointxyz=\pgfpointxyz@orig \let\pgfqpointxyz=\pgfqpointxyz@orig \let\tikz@checkunit=\tikz@checkunit@orig + \let\pgfpointpolarxy=\pgfpointpolarxy@orig + \let\pgfpatharcaxes=\pgfpatharcaxes@orig + \let\tikz@do@arc=\tikz@do@arc@orig }% \def\pgfplots@setxvec@restorepgfpoint#1{% @@ -10889,6 +11087,13 @@ % axis = 2d and plot=3d is forbidden here. \pgfplots@curplot@threedimfalse \fi + % + % + \pgfplots@LUA@visualization@init + % SIDE-effect: \ifpgfplots@LUA@backend@supported might have + % been switched to false here. + % + % \pgfplots@execute@at@begin@plot@visualization@internal % \pgfplots@markers@prepare@layered@graphics@marks @@ -10969,7 +11174,7 @@ \pgfplots@change@pgfpoints@to@axiscs \pgfplots@markers@install@plotmark@handler \let\pgfplots@visphase@name=\pgfplotsaxis@visphase@name@markers - \expandafter\pgfplots@coord@stream@finalize@storedcoords@START\pgfplots@stored@current@data\pgfplots@EOI + \pgfplots@coord@stream@finalize@storedcoords@START \endgroup }% @@ -10984,6 +11189,9 @@ \let\pgfpointxyz=\pgfplotspointaxisxyz \let\pgfqpointxy=\pgfplotsqpointaxisxy \let\pgfqpointxyz=\pgfplotsqpointaxisxyz + \let\pgfpatharcaxes=\pgfplots@patharcaxes + \let\pgfpointpolarxy=\pgfplots@pointpolarxy + \let\tikz@do@arc=\pgfplots@tikz@do@arc % % tikz checks for units before it calls \pgfpointxy . This must % not suffer from TeX's math restrictions, so we have to use the @@ -10992,19 +11200,109 @@ \fi }% +\def\pgfplots@disable@directionmath{% + \def\pgfplotstransformdirectionx##1{\def\pgfmathresult{##1}}% + \let\pgfplotstransformdirectiony=\pgfplotstransformdirectionx + \let\pgfplotstransformdirectionz=\pgfplotstransformdirectionx +}% + +% As of compat=1.11, pgfplots has to accept the following syntax elements: +% +% \draw[green,thick,->] (0,-1) arc[radius=1, start angle= -90, end angle=-180]; +% \draw[green,thick,->] (0,-1) arc[radius=1cm, start angle= -90, end angle=-180]; +% \draw[green,thick,->] (0,-1) arc[radius={transformdirectionx(1)}, start angle= -90, end angle=-180]; +% +% all of them should work. The last one (transformdirectionx) is due +% to legacy compatibility. Since the 1.11 code handles these syntaxes +% automatically, 'transformdirectionx' will be ignored silently. +\def\pgfplots@tikz@do@arc#1#2#3#4{% + \begingroup + % strip 'transformdirectionx' if it occurs in the angles: + \pgfplots@disable@directionmath + \pgfmathparse{#3}% + \t@pgfplots@toka={\tikz@do@arc@orig{#1}{#2}}% + \edef\pgfplots@arc@x{% + \pgfmathresult + \ifpgfmathunitsdeclared pt\fi + }% + \pgfmathparse{#4}% + \xdef\pgfplots@arc@y{% + \pgfmathresult + \ifpgfmathunitsdeclared pt\fi + }% + % ok, invoke the TikZ command with the expanded args: + \xdef\pgfplots@glob@TMPa{\the\t@pgfplots@toka{\pgfplots@arc@x}{\pgfplots@arc@y}}% + \endgroup + \pgfplots@glob@TMPa +}% + +\def\pgfplots@polarxy@#1and #2\@@{% + \edef\pgfplots@polarxy@X{#1}% + \edef\pgfplots@polarxy@Y{#2}% +} +\def\pgfplots@pointpolarxy#1#2{% + \pgfutil@in@{and }{#2}% + \ifpgfutil@in@% + \pgfplots@polarxy@#2\@@% + \else% + \pgfplots@polarxy@#2and #2\@@% + \fi% + \pgfmathparse{#1}% + \let\pgfpoint@angle=\pgfmathresult% + \pgfmathcos@{\pgfpoint@angle}% + \let\pgfpoint@cos=\pgfmathresult + \pgfmathsin@{\pgfpoint@angle}% + \let\pgfpoint@sin=\pgfmathresult + % + \begingroup + \pgfplots@plot@coords@mathparsertrue + \pgf@process{% + \pgfplotspointaxisxyz{\pgfplots@polarxy@X*\pgfpoint@cos}{\pgfplots@polarxy@Y*\pgfpoint@sin}{0}% + }% + \endgroup +}% + +% #1 = angle of first point +% #2 = angle of second point +% #3 = first axis +% #4 = second axis +\def\pgfplots@patharcaxes#1#2#3#4{% + {% + % see docs of \pgfplots@tikz@do@arc for a motivation: + \pgfplots@disable@directionmath + % + % ok, now, evaluate the arcs. Since this implements + % 'substitute pgfpoint', we have to evaluate the angles via + % 'axis direction cs' ... + \let\pgfpointxy=\pgfplotspointaxisdirectionxy + \let\pgfpointxyz=\pgfplotspointaxisdirectionxyz + % + \pgftransformtriangle{\pgfpointorigin}{#3}{#4}% + % + % ... and the coordinates as such using 'axis cs': + \let\pgfpointxy=\pgfplotspointaxisxy + \let\pgfpointxyz=\pgfplotspointaxisxyz + % + \pgfpatharc{#1}{#2}{1pt}% + }% +}% + \def\pgfplots@checkunit@fpu#1{% \ifpgfplots@usefpu - \edef\pgfplots@checkunit@fpu@restore{% - \pgflibraryfpuifactive{% - % ok, leave it active - }{% - \noexpand\pgfkeys{/pgf/fpu=false}% - }% - }% + \begingroup \pgfkeys{/pgf/fpu}% \tikz@checkunit@orig{#1}% \pgfmathfloattofixed{\pgfmathresult}% - \pgfplots@checkunit@fpu@restore + \xdef\pgfplots@glob@TMPd{% + \iftikz@isdimension + \noexpand\tikz@isdimensiontrue + \else + \noexpand\tikz@isdimensionfalse + \fi + \noexpand\def\noexpand\pgfmathresult{\pgfmathresult}% + }% + \endgroup + \pgfplots@glob@TMPd \else \tikz@checkunit@orig{#1}% \fi @@ -11219,3 +11517,4 @@ }% \catcode`\;=\pgfplots@oldcatcodesemicolon +\catcode`\"=\pgfplots@oldcatcodedoublequote |