diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex | 680 |
1 files changed, 419 insertions, 261 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex index 6518b542006..6f2f127afde 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex @@ -4,7 +4,7 @@ % % 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-2010 by Christian Feuersänger. @@ -13,12 +13,12 @@ % 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/>. % @@ -89,8 +89,8 @@ \else \pgfplotspointbblowerleft \fi}% - {\pgfpointxy@orig{##1}{##2}}% - %I use the '@orig' variant here because descriptions may + {\pgfpointxy@orig{##1}{##2}}% + %I use the '@orig' variant here because descriptions may %\let\pgfpointxy=\pgfplotspointdescriptionxy }% }% @@ -104,7 +104,7 @@ \else \pgfplotspointbblowerleft \fi}% - {\pgfqpointxy@orig{##1}{##2}}% + {\pgfqpointxy@orig{##1}{##2}}% }% }% \pgfplotspoint@initialisation@axes @@ -131,7 +131,7 @@ }% % Determine final axes this does also fix the axis' dimension. -% There are the following cases: +% There are the following cases: % 1. the user really wants a fixed dimension, % i.e. he used 'scale only axis'. % Then, we have to work to get the correct dimension! @@ -141,9 +141,9 @@ % % If I am not mistaken, this does ONLY affect the final size, % not the relative plot precision. -% +% % FIXME : really compute the plot precision! -% +% % 2. The use specified width and/or height, but not 'scale only % axis'. Accept inaccurate final widths/heights (see above). % @@ -175,7 +175,7 @@ \pgfplots@ycoordminTEX=\pgf@y % %-------------------------------------------------- - % FIXME : WHAT IS THIS HERE FOR? + % FIXME : WHAT IS THIS HERE FOR? % \pgfplotsqpointxy{\pgfplots@xmax}{\pgfplots@ymax}% % \ifx\pgfplots@rectangle@width\pgfutil@empty % \def\pgfplots@tmp@xmax@ymin{\pgfplotsqpointxy{\pgfplots@xmax}{\pgfplots@ymin}}% @@ -197,7 +197,7 @@ % \advance\pgf@x\pgfplots@height % \edef\pgfplots@tmp@xmin@ymax{\noexpand\pgfqpoint{\noexpand\pgfplots@xcoordminTEX}{\the\pgf@x}}% % \fi - %-------------------------------------------------- + %-------------------------------------------------- \pgfpointdiff {\pgfqpoint{\pgfplots@xcoordminTEX}{\pgfplots@ycoordminTEX}} {\pgfplotspointmaxminmin}% @@ -293,7 +293,7 @@ % 2. Any other point coordinate should not be altered. % % Former versions installed a shift and changed e_x, e_y and -% e_z. However, that was misleading as it disabled point 2). +% e_z. However, that was misleading as it disabled point 2). % So, my idea here is to replace \pgfpointxy and \pgfqpointxy % such that they install the correct coordinate system before % doing anything else. @@ -323,7 +323,7 @@ % argument is omitted, the <default shift> will be used (0pt if this % argument has been omitted as well). % -% \pgfplotspointticklabelcs#1#2: +% \pgfplotspointticklabelcs#1#2: % #1 is the axis (either x,y or z) % #2 is the coordinate (either <relative coord> or <relative coord>,<shift>) % @@ -403,7 +403,7 @@ % component #1, #2 and #3. The results are directly communicated to % \pgfplotsqpointxyz. % -% Expects #1, #2 and #3 to be numbers with units and issues a \pgfplotsqpointxyz +% Expects #1, #2 and #3 to be numbers with units and issues a \pgfplotsqpointxyz \def\pgfplotsqpointxyzabsolutesize#1#2#3{% \begingroup \pgf@xa=#1\relax @@ -419,7 +419,7 @@ % Denotes a point in a twodimensional hyperplane. The hyperplane is % one of the six planes of the threedimensional axis cube. -% +% % The meaning of coordinates #1 and #2 will be redefined depending on % which surface we are currently processing. You can get the axis % names for '#1' (a) and '#2' (b) using the macros @@ -456,7 +456,7 @@ \pgfplots@error{Internal logic error: \string\pgfplotspointonorientedsurfaceab\ used although surface has not been declared! You need to call \string\pgfplotspointonorientedsurfaceabsetupfor xyz\ or its friends to do so.}% }% -% This is a shortcut for +% This is a shortcut for % \pgfpointadd % {\pgfplotspointonorientedsurfaceab{#1}{#2}} % {<shift in B direction of #3>} @@ -479,7 +479,7 @@ % This macro will be defined after % \pgfplotspointonorientedsurfaceabsetupfor... -% routines. It expands to a three-character string +% routines. It expands to a three-character string % where the first character contains information about the x axis, % the second about the y axis and the third about the z axis. % @@ -518,7 +518,7 @@ % axis and 'b' is the y axis and the z coordinate has been fixed with % \pgfplotspointonorientedsurfaceabsetupforsetz{}. % -% The Z value needs to be fixed with +% The Z value needs to be fixed with % \pgfplotspointonorientedsurfaceabsetupforsetz . \def\pgfplotspointonorientedsurfaceabsetupfor@@xyz{% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxyz{##1}{##2}{\pgfplotspointonorientedsurfaceabsetupfor@fixedz}}% @@ -576,7 +576,7 @@ }% % Fixes 'x' to #1 for use in -% \pgfplotspointonorientedsurfaceabsetupfor zyx and +% \pgfplotspointonorientedsurfaceabsetupfor zyx and % \pgfplotspointonorientedsurfaceabsetupfor yzx. % % #1: The fixed value for 'x' (a coordinate in transformed range). @@ -650,7 +650,7 @@ % the currently active oriented surface. % #2 : the macro which will contain the output axis line specification % (three-char-string). -% +% % Example: % \pgfplotspointonorientedsurfaceabsetupfor xyz % \pgfplotspointonorientedsurfaceabsetupforsetz{<lower z limit>}{0} @@ -721,8 +721,8 @@ % three-character-string '#1' is a foreground surface and code '#3' if % the surface '#1' is a background surface. % -% #1: a three-char-string with the keys -% 'v' = 'varying', +% #1: a three-char-string with the keys +% 'v' = 'varying', % '0' = 'lower axis limit', % '1' = 'upper axis limit'. % The string 'v0v' means that x and z are varying in that surface @@ -869,7 +869,7 @@ % This does only handle foreground/background issues; it has NOTHING % to do with the actual checks if grid lines are active or not. \def\pgfplots@ifgridlines@onorientedsurf@should@be@drawn#1#2{% - % grid lines shall be drawn + % grid lines shall be drawn % if and only if BOTH adjacent axis lines shall be drawn: \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn@allaxislinevariations{0}{% % remark: this is ALWAYS true for 2D plots. @@ -910,7 +910,7 @@ % surface axis (which is called the 'b' axis). % Thus, the following values for '#2' can be expected: % - '' (empty) if the line is not on the surface, -% - 'v' if the line IS on the surface, and '#1' contains a 'v' +% - 'v' if the line IS on the surface, and '#1' contains a 'v' % in direction of the surface's 'b' axis. % - '0' if the line IS on the surface and '#1' contains a '0' in % direction of the surface's 'b' axis, @@ -961,7 +961,7 @@ \let#3=\pgfplots@loc@TMPa }% -% IMPLEMENTATION: +% IMPLEMENTATION: % The return value is 'yes, #1#2#3 is on the oriented surface #4#5#6' % if and only if for all three character pairs, the following single % relations hold. @@ -970,7 +970,7 @@ % '0' : is either 0, a, b, v or 2 (i.e. NOT 1) FIXME : is the '2' correct here!? % '1' : is either 1, a, b, v or 2 (i.e. NOT 0) % '2' : is either 2, a, b, v (i.e. NOT 0 or 1) -% That's all. +% That's all. % % If the 'oriented surface char' is 'v', then we actually don't have % an oriented surface but just a surface. @@ -1049,7 +1049,7 @@ % Provides a point on an arbitrary axis (identified by a % three-character-string) which can take any value on that axis and -% which is shifted in the direction of the outer normal vector. +% which is shifted in the direction of the outer normal vector. % % #1: a three-character-string denoting the desired axis % #2: the coordinate on that axis (the coordinate for the 'v' @@ -1078,9 +1078,9 @@ % A variant of \pgfplotsqpointoutsideofaxis with relative values for % #2. -% That means -% '#2 = 0' === lower axis limit -% and +% That means +% '#2 = 0' === lower axis limit +% and % '#2 = 1' === upper axis limit. \def\pgfplotsqpointoutsideofaxisrel#1#2#3{% \begingroup @@ -1304,7 +1304,7 @@ % % The idea is to return the same normal vector as if this would be a boxed axis. % To this end, we have to access the "ticklabel axis spec" - % which would have been used in this case. + % which would have been used in this case. % % We computed it at startup. Might be a hack ... :-( \edef\pgfplots@loc@TMPb{\csname pgfplots@#1ticklabelaxisspec@box\endcsname}% @@ -1466,7 +1466,7 @@ % }% % \endgroup % }% -%-------------------------------------------------- +%-------------------------------------------------- % Helper method for \pgfplotsqpointoutsideofaxis and its variants. % #1: an axis (x,y or z) @@ -1508,7 +1508,7 @@ % coordinate directions. % % \pgfplotstransformtoaxisdirection[<options>]{<axis char>} -% +% % <axis char>: the coordinate direction (one of x,y or z) % % The code is pretty much the same as \pgftransformlineattime, except @@ -1540,7 +1540,7 @@ % '#1#2#3': \pgfqpointscale{\csname pgfplotsunit#2invlength\endcsname}{\csname pgfplotspointunit#2\endcsname}% % - \ifdim\pgf@x<0pt% + \ifdim\pgf@x<0pt% % oh. upside down. \pgfkeysvalueof{/pgfplots/sloped/execute for upside down}% \ifpgfplots@sloped@allowupsidedown @@ -1552,8 +1552,8 @@ \fi% % \pgf@ya=-\pgf@y% - % set up rotation matrix - % [ cos(alpha) sin(alpha); + % set up rotation matrix + % [ cos(alpha) sin(alpha); % -sin(alpha) cos(alpha) ] % where cos(alpha) = n_x and sin(alpha) = n_y: \pgftransformcm% @@ -1581,15 +1581,15 @@ % \pgfdeclaregenericanchor{#3}{\pgfplots@borderanchor@for@axis{#1}{#2}{##1}}% \pgfdeclaregenericanchor{#3 opposite}{\pgfplots@borderanchor@for@axis@{#1}{#2}{##1}{+1}}% - % + % % This variant will ALWAYS be placed on the boundary of the node. % It is deprecated, I am keeping it for some time.... \pgfdeclaregenericanchor{#3*}{% \csname pgf@anchor@##1@border\endcsname{% \pgf@process{% % - % I want to rotate the node FIRST, then - % I'd like to get the boundary anchor! + % I want to rotate the node FIRST, then + % I'd like to get the boundary anchor! % % My idea: apply the INVERSE transformation % matrix, then compute the boundary anchor. @@ -1676,7 +1676,7 @@ % we apply the inverse CM onto it here: \pgf@pos@transform\pgf@x\pgf@y \edef\pgfplots@tmp@normaldir{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}% - % + % \pgfplots@borderanchor@snap@to@nearest@anchor{}% takes \pgf@x and \pgf@y \let\pgfplots@anchor=\pgfplotsretval % @@ -1748,7 +1748,7 @@ \let\pgfplots@anchor@inner=\pgfplotsretval % % - % verify that |n^T d | + % verify that |n^T d | \pgf@xc=\pgf@sys@tonumber\pgf@xa\pgf@xb \advance\pgf@xc by\pgf@sys@tonumber\pgf@ya\pgf@yb \ifdim\pgf@xc<0pt \pgf@xc=-\pgf@xc \fi @@ -1762,7 +1762,7 @@ {\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@xa}% {\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@ya}% }% - % + % % This here controls the anchor! Changing it might be more % useful than I thought in the first place... \pgf@sh@reanchor{#3}{\pgfplots@anchor@inner}% @@ -1806,7 +1806,7 @@ % Now: % auto-determine the canonical (north, north east etc) anchor % at which the node touches the axis (remember: the axis is to - % be found in direction of the normal vector). + % be found in direction of the normal vector). % % This is kind of a snap-to-nearest-existing-anchor feature. But % it tends to move the node too far away. It is used as starting @@ -1884,10 +1884,10 @@ \pgfplotsmathvectortostring{\pgfplots@view@dir@threedim}{default}% \edef\normal{view = (\pgfplotsretval),^^J}% \fi - \message{^^J - x = (\the\pgf@xx,\the\pgf@xy),^^J - y =(\the\pgf@yx,\the\pgf@yy),^^J - z = (\the\pgf@zx,\the\pgf@zy),^^J + \message{^^J + x = (\the\pgf@xx,\the\pgf@xy),^^J + y =(\the\pgf@yx,\the\pgf@yy),^^J + z = (\the\pgf@zx,\the\pgf@zy),^^J \normal unit vector ratio=[\X\space\Y\space 1],^^J}% \endgroup @@ -1895,7 +1895,7 @@ % ================================================================================== -% +% % COORDINATE MATH. % % ================================================================================== @@ -1910,7 +1910,7 @@ % possible to use yet a further instance for point meta (or whatever). % % Coordinate math is used to compute axis limits and to map the range -% into the pgf number format. +% into the pgf number format. % % It is *not* necessarily used for \pgfmathparse, since switching % the number format of \pgfmathparse is quite involved (at the time of @@ -1921,7 +1921,7 @@ % #2: methods to override the default. % % The available methods are documented and shown below in the -% \pgfqkeys listing. +% \pgfqkeys listing. % % @see the predefined examples, also shown below. \def\pgfplotsdeclarecoordmath#1#2{% @@ -2139,7 +2139,7 @@ set log basis/.code= {\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ set log basis\endcsname##1{#1}},% % - % The inverse to 'log e '. + % The inverse to 'log e '. exp e/.code= {\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ exp e\endcsname##1{#1}},% % @@ -2162,7 +2162,7 @@ {\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ datascaletrafo set shift\endcsname##1{% #1\relax\pgfplotscoordmathnotifydatascalesetfor{\pgfplotscoordmathid}% }},% - % + % % Defines \pgfmathresult to contain the two parameters in the form % {#1}{#2} required for 'datascaletrafo set params': % #1: the EXPONENT (as integer) @@ -2333,7 +2333,7 @@ \else % log basis a ---> log basis 10 % - % log_a x = log x / log a + % log_a x = log x / log a % log_10 x = log_a x * log a / log(10) = log x / log(10) [OK] \csname pgfpmth@#1@op\endcsname{multiply}{{#2}{\pgfmathresult}}% \fi @@ -2352,7 +2352,7 @@ parsenumber={% \pgfmathfloatparsenumber{#1}% \expandafter\pgfmathfloatgetflagstomacro\expandafter{\pgfmathresult}\pgfplotsretval - \ifnum\pgfplotsretval>2 + \ifnum\pgfplotsretval>2 \let\pgfmathresult=\pgfutil@empty \else \pgfmathfloattofixed\pgfmathresult @@ -2371,7 +2371,7 @@ }{}, parsenumber=\pgfmathfloatparsenumber{#1}, parse={% - \begingroup + \begingroup \pgfkeys{/pgf/fpu,% /pgf/fpu/output format=float,% }% @@ -2563,7 +2563,7 @@ \pgf@yb=\pgfplots@current@point@z pt % \fi \def\pgfplots@loc@TMPa{#2}% - % + % % I assume that \pgfplots@[xyz]min@reg and min@reg are registers % containing the limits. \ifdim\pgf@xa<\pgfplots@xmin@reg @@ -2630,7 +2630,7 @@ % % a macro used to initialise the point meta source when it is % selected. - % This macro body is invoked by pgfplots when someone types + % This macro body is invoked by pgfplots when someone types % 'point meta=x' -> will invoke 'pgfpmeta@x@initfor{}'. % The first argument to initfor can be supplied by the user. % PRECONDITION for 'initfor': @@ -2657,7 +2657,7 @@ % - the other input coordinates are already read. % POSTCONDITION for '@assign': % - \pgfplots@current@point@meta is ready for use: - % - EITHER a parsed floating point number + % - EITHER a parsed floating point number % - OR an empty string, % - OR a symbolic string (if the issymbolic boolean is true) % The default implementation is @@ -2822,9 +2822,9 @@ % Internal stream methods. % -% Please overwrite +% Please overwrite % - \pgfplots@coord@stream@start@, -% - \pgfplots@coord@stream@end@ and +% - \pgfplots@coord@stream@end@ and % - \pgfplots@coord@stream@coord@ % if you implement streams. % @@ -2934,8 +2934,8 @@ % In other words, the \pgfplotsscanlinelengthincrease routine is % invoked *before* the point is processed. That's important. % -% Now, \pgfplotsscanlinelength expands to either -% a) a negative number in which case there is no +% Now, \pgfplotsscanlinelength expands to either +% a) a negative number in which case there is no % unique scanline length. % More precisely, -1 means "there was no end-of-scanline marker" % -2 means "there where end-of-scanline markers, but the scanlines @@ -2972,7 +2972,7 @@ \newif\ifpgfplots@emptyline@compat -% Invoked for 'empty line=auto'. +% Invoked for 'empty line=auto'. % % @POSTCONDITION: '/pgfplots/empty line' is set to something useful % (not auto) @@ -3011,7 +3011,7 @@ \def\pgfplotsscanlinelength@scanline@complete{% \ifnum\pgfplots@scanlinelength>0 \ifnum\c@pgfplots@scanlineindex=0 - % + % % \pgfplotsscanlinecomplete % \pgfplotsscanlinecomplete % \pgfplotsscanlinecomplete @@ -3050,7 +3050,7 @@ % ------------------------------------------------------------------------------- % % empty line=none class: -% +% \let\pgfplotsscanlinelength@none@initzero=\pgfutil@empty \let\pgfplotsscanlinelength@none@increase=\relax \let\pgfplotsscanlinelength@none@complete=\relax @@ -3061,7 +3061,9 @@ \def\pgfplotsscanlinelength@nan@initzero{% \def\pgfplotsscanlinelength@nan@isfirst{1}% \let\pgfplotsscanlinelength@nan@pendingwork=\relax - \pgfplotsifinaxis{}{\let\pgfplotsaxisserializedatapoint=\relax}% + \pgfplotsifinplot{}{% + \let\pgfplotsaxisserializedatapoint=\relax + }% }% \def\pgfplotsscanlinelength@nan@increase{% \def\pgfplotsscanlinelength@nan@isfirst{0}% @@ -3070,33 +3072,38 @@ \def\pgfplotsscanlinelength@nan@complete{% \if1\pgfplotsscanlinelength@nan@isfirst \else - \def\pgfplotsscanlinelength@nan@pendingwork{% - \ifpgfplots@LUA@backend@supported - \pgfplotsutil@directlua{pgfplots.texSurveyAddJump()}% - \else - % this will be executed when the next point has been - % found. - \def\pgfplots@current@point@x{}% - \def\pgfplots@current@point@y{}% - \def\pgfplots@current@point@z{}% - % simply serialize an empty point. That works -- the - % visualization phase checks if the coordinates are empty and - % visualizes them as "jump" - % - % Note that \pgfplotsplothandlersurveypoint is not a good - % choice here unless one employs its 'unbounded coords=jump' - % feature - \def\pgfplotsaxisplothasjumps{1}% - \pgfplotsaxisserializedatapoint - \fi - % + \pgfplotsifinplot{% + \let\pgfplotsscanlinelength@nan@pendingwork=\pgfplotsscanlinelength@nan@pendingwork@PREPARED + }{% \let\pgfplotsscanlinelength@nan@pendingwork=\relax }% \fi \def\pgfplotsscanlinelength@nan@isfirst{1}% }% \let\pgfplotsscanlinelength@nan@cleanup=\relax -% +\def\pgfplotsscanlinelength@nan@pendingwork@PREPARED{% + \ifpgfplots@LUA@backend@supported + \pgfplotsutil@directlua{pgfplots.texSurveyAddJump()}% + \else + % this will be executed when the next point has been + % found. + \def\pgfplots@current@point@x{}% + \def\pgfplots@current@point@y{}% + \def\pgfplots@current@point@z{}% + % simply serialize an empty point. That works -- the + % visualization phase checks if the coordinates are empty and + % visualizes them as "jump" + % + % Note that \pgfplotsplothandlersurveypoint is not a good + % choice here unless one employs its 'unbounded coords=jump' + % feature + \def\pgfplotsaxisplothasjumps{1}% + \pgfplotsaxisserializedatapoint + \fi + % + \let\pgfplotsscanlinelength@nan@pendingwork=\relax +}% +% % ------------------------------------------------------------------------------- @@ -3105,7 +3112,21 @@ \def\pgfplotsaxisplothasunboundedpointmeta{0}% \newif\ifpgfplotsaxisparsecoordinateok -% Initialises +% Possibly values: +% N = none, is not in \addplot +% S = survey +% V = visualization +\def\pgfplotsaxisplotphase{N} + +\def\pgfplotsifinplot#1#2{% + \if\pgfplotsaxisplotphase N% + #2% + \else + #1% + \fi +}% + +% Initialises % \pgfplots@coord@stream@start % \pgfplots@coord@stream@coord % \pgfplots@coord@stream@end @@ -3184,12 +3205,12 @@ \begingroup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \let\E=\noexpand - % + % %\message{Assembled update-limits \ifpgfplots@curplot@threedim 3D\else 2D\fi macro to {\meaning\pgfplotsaxisupdatelimitsforcoordinate}}% \ifpgfplots@bb@isactive \else - % we are inside of - % \pgfplotsinterruptdatabb + % we are inside of + % \pgfplotsinterruptdatabb % .. % \endpgfinterruptboundingbox % -> don't change data limits! @@ -3228,17 +3249,17 @@ % % A data point might be a complicated thing which contains % multiple coordinates. You need to invoke - % \pgfplotsaxisparsecoordinate and + % \pgfplotsaxisparsecoordinate and % \pgfplotsaxispreparecoordinate for each of them. But % \pgfplotsaxisdatapointsurveyed is invoked once for the complete % set. - % + % % @PRECONDITION % - \pgfplots@current@point@[xyz] contain final coordinates % (i.e. output of \pgfplotsaxispreparecoordinate) % % @POSTCONDITION - % - stacked plot things, + % - stacked plot things, % - error bars, % - xtick=data % are all processed. @@ -3298,7 +3319,7 @@ \ifpgfplots@warn@for@filter@discards \E\pgfplots@message{% NOTE: coordinate (\E\pgfplots@current@point@x@unfiltered,\E\pgfplots@current@point@y@unfiltered\ifpgfplots@curplot@threedim,\E\pgfplots@current@point@z@unfiltered\fi) - has been dropped because + has been dropped because \E\ifx\E\pgfplots@unbounded@dir\E\pgfutil@empty of a coordinate filter. \E\else @@ -3340,7 +3361,7 @@ % %\message{Prepared macro \string\pgfplots@update@limits@for@one@point: {\meaning\pgfplotsaxisupdatelimitsforcoordinate}}% %\message{Prepared macro \string\pgfplots@process@one@point: {\meaning\pgfplots@process@one@point}}% - % + % \let\pgfplots@coord@stream@start@=\pgfplots@PREPARE@COORD@STREAM@start@ \def\pgfplots@coord@stream@coord@{% \def\pgfplots@set@perpointmeta@done{0}% @@ -3467,7 +3488,7 @@ \endgroup }% % This is the \pgfplots@coord@stream@end@ routine which is invoked by -% \pgfplots@PREPARE@COORD@STREAM. +% \pgfplots@PREPARE@COORD@STREAM. % % It finalizes the first pass through the input coordinates and % remembers the preprocessed \addplot command. @@ -3575,14 +3596,14 @@ \ifpgfplots@LUA@backend@supported \noexpand\pgfplots@LUA@backend@supportedtrue \pgfplots@LUA@backend@serialized@commands - \else + \else \noexpand\pgfplots@LUA@backend@supportedfalse \fi - \noexpand\def\noexpand\plotnum{\the\pgfplots@numplots}% + \noexpand\def\noexpand\plotnum{\plotnum}% % % store \plotnumofactualtype \noexpand\def\noexpand\plotnumofactualtype{\plotnumofactualtype}% - % ... and make sure that it + % ... and make sure that it % remains the same type even if some plot handler uses % other plot handlers internally: \noexpand\def\noexpand\pgfplotsplothandlername@actual{\pgfplotsplothandlername@actual}% @@ -3679,7 +3700,7 @@ \pgfkeysgetvalue{/pgfplots/#1 filter/.@cmd}\pgfplots@loc@TMPc \ifx\pgfplots@loc@TMPc\pgfplots@empty@command@key \let\pgfplotsretval=\pgfutil@empty - \else + \else \pgfplots@ifisfilterexpression{#1 filter}{% \pgfkeysgetvalue{/pgfplots/#1 filter/@expressionvalue}\pgfplotsretval \expandafter\pgfplotsutilifcontainsmacro\expandafter{\pgfplotsretval}{% @@ -3751,11 +3772,10 @@ \if m\pgfplots@colormap@access \else \if c\pgfplots@colormap@access - \pgfplots@LUA@survey@log@deactivation{color map access=piecewise constant not supported (yet)}% \else \pgfplots@LUA@survey@log@deactivation{color map access=direct not supported (yet)}% + \pgfplots@LUA@backend@supportedfalse \fi - \pgfplots@LUA@backend@supportedfalse \fi \pgfplotscolormapifisuniform{\pgfkeysvalueof{/pgfplots/colormap name}}{% }{% @@ -3764,6 +3784,14 @@ \pgfplots@LUA@backend@supportedfalse }% % + \ifpgfplots@curplot@threedim + \else + \ifpgfplots@threedim + \pgfplots@LUA@survey@log@deactivation{2d plots in 3d axis currently unsupported}% + \pgfplots@LUA@backend@supportedfalse + \fi + \fi + % \ifpgfplots@LUA@backend@supported \edef\pgfplots@LUA@backend@plotnum{\pgfutil@directlua{tex.sprint(\pgfplotsHASH pgfplots.gca.plothandlers)}}% \begingroup @@ -3859,15 +3887,27 @@ % Otherwise we would have nothing here. % FIXME : what about \pgfplots@LUA@backend@failed in this context!? \pgfplots@log{\pgfplots@LUA@loglevel@info}{Using 'lua backend=false' for visualization of plot \the\pgfplots@numplots\space (type '\pgfplotsplothandlername'): it has no LUA visualizer.}% - \expandafter\def\expandafter\pgfplots@stored@current@data\expandafter{% + % NOTE: + % I use two levels of \expandafter here because 'lua debug =trace' + % introduces another level of expansion. And I do not + % want to use \edef... silly, perhaps..? + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\pgfplots@stored@current@data + \expandafter\expandafter\expandafter{% \pgfplotsutil@directlua{pgfplots.texGetSurveyedCoordsToPgfplots()}% }% \else % visualize using LUA! ... and acquire the coordinates. - \expandafter\def\expandafter\pgfplots@stored@current@data\expandafter{% + % NOTE: + % I use two levels of \expandafter here because 'lua debug =trace' + % introduces another level of expansion. And I do not + % want to use \edef... silly, perhaps..? + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\pgfplots@stored@current@data + \expandafter\expandafter\expandafter{% \pgfplotsutil@directlua{pgfplots.texVisualizePlot(\pgfplotsplothandlerLUAvisualizerfactory)}% }% -%\message{plot \plotnum: LUA backend returned \pgfplots@stored@current@data^^J}% +%\message{plot \plotnum: LUA backend returned \meaning\pgfplots@stored@current@data^^J}% % % ... and ensure that the resulting % \pgfplots@stored@current@data can be deserialized. It @@ -4009,14 +4049,14 @@ % \pgfplotsaxistransformcs. % #1: the source coordinate system % #2: the target coordinate system -% #3: the transformation code. +% #3: the transformation code. % % @see \pgfplotsaxistransformcs for what #3 should do. % % This does also declare a coordinate system for use in 'data cs'. % The minimal requirements are to define the transformations from and % to "cart" (cartesian coordinates). -% +% \def\pgfplotsdefinecstransform#1#2#3{% \expandafter\def\csname pgfp@transform@#1@to@#2\endcsname{#3}% }% @@ -4145,9 +4185,9 @@ % Handle User-defined parts which should be serialized as well. % This preparation tool should be called at the start of both, survey % and visualization phase. -% +% % @PRECONDITION -% - the macros +% - the macros % \pgfplotsaxisserializedatapoint@private % \pgfplotsaxisdeserializedatapointfrom@private % are known and valid. @@ -4160,7 +4200,7 @@ % \pgfplotsaxisdeserializedatapointfrom@private % have been patched to incorporate the '/pgfplots/visualization % depends on' feature. -% +% \def\pgfplots@prepare@visualization@dependencies{% \pgfkeysgetvalue{/pgfplots/visualization depends on/list}\pgfplots@loc@TMPa \ifx\pgfplots@loc@TMPa\pgfutil@empty @@ -4176,7 +4216,7 @@ % % prepare % \t@pgfplots@tokc={<\macro1><\macro2><\macro3>...} - \t@pgfplots@tokc={}% + \t@pgfplots@tokc={}% \expandafter\pgfplotsutilforeachcommasep\expandafter{\pgfplots@loc@TMPa}\as\pgfplots@loc@TMPa{% \ifx\pgfplots@loc@TMPa\pgfutil@empty \else @@ -4224,7 +4264,7 @@ \escapechar=-1 \xdef\pgfplots@glob@TMPa{\string##1}% \endgroup - \pgfutil@ifundefined{\pgfplots@glob@TMPa}{% + \pgfutil@ifundefined{\pgfplots@glob@TMPa}{% \begingroup \t@pgfplots@toka={##1}% \pgfplotsthrow{invalid argument} @@ -4246,7 +4286,7 @@ \escapechar=-1 \xdef\pgfplots@glob@TMPa{\string#1}% \endgroup - \pgfutil@ifundefined{\pgfplots@glob@TMPa}{% + \pgfutil@ifundefined{\pgfplots@glob@TMPa}{% \begingroup \t@pgfplots@toka={#1}% \pgfplotsthrow{invalid argument} @@ -4267,7 +4307,7 @@ \t@pgfplots@tokc=\expandafter{\the\t@pgfplots@tokc\csname assign@\string#2\endcsname}% }% -% task: define a macro '\csname assign@\string#2\endcsname' which, when executed, +% task: define a macro '\csname assign@\string#2\endcsname' which, when executed, % defines \csname\string#2@value\endcsname such that it expands % to a the correct value. \def\pgfplots@prepare@visualization@depends@on@preparetype#1\as#2{% @@ -4307,9 +4347,9 @@ % ok, prepare the value. \def\pgfplots@loc@TMPb{#2}% \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb - % oh - a special case! We have value\macro\as\macro. + % oh - a special case! We have value\macro\as\macro. \expandafter\def\csname\string#2@value\endcsname{#2}% - % + % % this is special; we do not need to EXECUTE assign@\string#2 to arrive at its value. % But we need to define #2@value as that will be stored. \expandafter\let\csname assign@\string#2\endcsname=\relax @@ -4345,7 +4385,7 @@ % \pgfplots@PREPARE@COORD@STREAM@end@. % % POSTCONDITION: -% assigns '/pgfplots/#1 coord sorting=[+-]' +% assigns '/pgfplots/#1 coord sorting=[+-]' % i.e. whether #1 (x or y or z) coordinates are in ascending (+) ordering or in % descending order (-). \def\pgfplots@PREPARE@COORD@STREAM@end@determinecoordsorting#1{% @@ -4365,7 +4405,7 @@ % % The trafo is expected to prepare meta information before it is used % as input to \pgfplotscolormapaccess (or -% \pgfplotscolormapdefinemappedcolor). Thus, the 10^k is chosen to be +% \pgfplotscolormapdefinemappedcolor). Thus, the 10^k is chosen to be % the same as \pgfplotscolormaprange (which is 1000 per default). % % If there is no data range (for example because meta information is @@ -4511,7 +4551,7 @@ \def\pgfplotspointmetatransformed{1000}% use the maximum because it is usually divided by 1000 % A command which is readily available during the visualization phase of each plot. -% +% % It takes existing point meta data and transforms it, i.e. it defines % \pgfplotspointmetatransformed. % @@ -4542,7 +4582,7 @@ its value is empty. % \if1\csname pgfpmeta@\pgfplotspointmetainputhandler @explicitinput\endcsname% \pgfplots@addplot@point@meta@description@of@explicit@value - \else + \else Please ensure that the value exists and is not empty \fi }% @@ -4574,7 +4614,7 @@ % call \pgfplots@coord@stream@coord % \pgfplots@coord@stream@end % -% #1 a sequence of coordinates of the form +% #1 a sequence of coordinates of the form % '(x,y)' or '(x,y,z)' % or % '(x,y[,z]) +- (ex,ey)' @@ -4875,7 +4915,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 % % A coordinate stream which works like this: -% +% % ------------- % \pgfplots@coord@stream@start % @@ -4918,7 +4958,7 @@ % A common routine which resets internal data structures for the % survey phase, i.e. it is the shared implementation for all \addplot % variations. -% +% % It takes all options which are provided to \addplot, sets them (at % least partially) and remembers them for the command serialization. % @@ -4933,11 +4973,12 @@ % - internal datastructures are initialised (coordinate indexing, fpu) % - all keys which are required for the current plot are determined % (and set if necessary). -% They are stored into +% They are stored into % \pgfplots@addplot@survey@@optionlist. -% +% \def\pgfplots@start@plot@with@behavioroptions#1{% %\begingroup%<-- has been moved to \pgfplots@addplotimpl@plot@withoptions + \def\pgfplotsaxisplotphase{S}% "in survey" \c@pgfplots@coordindex=0 \def\pgfplots@current@point@coordindex{\the\c@pgfplots@coordindex}% can be used inside of coordinate filters. \def\coordindex{\pgfplots@current@point@coordindex}% valid inside of \addplot @@ -4967,7 +5008,7 @@ \fi % % make sure it is reset, just in case it is not supported by the - % input method. + % input method. \pgfplotsscanlinelengthinitzero % \pgfplots@getcurrent@plothandler\pgfplots@basiclevel@plothandler @@ -5072,12 +5113,12 @@ % The main interface to draw a plot into an axis. % % Usage: -% \addplot +% \addplot % plot coordinates { % (0,0) % (1,1) % }; -% +% % or % % \addplot[color=blue,mark=*] @@ -5087,14 +5128,14 @@ % }; % % or one of the other input types. -% +% % The first syntax will use the next plot specification in the list % \autoplotspeclist -% and the first will use blue color and * markers. +% and the first will use blue color and * markers. % % \addplot [<style options>] plot[<behavior options>] <input type and args> <post plot path> ; % \addplot3[<style options>] plot[<behavior options>] <input type and args> <post plot path> ; -% +% % The complete accumulation is done GLOBALLY. It should be safe to put % '\addplot' into local groups. % @@ -5103,7 +5144,7 @@ % % Low-level implementation: % -% \pgfplots@addplot +% \pgfplots@addplot % \pgfplots@addplotimpl % \pgfplots@start@plot@with@behavioroptions <--- \begingroup % ... @@ -5132,7 +5173,7 @@ }{% \pgfplots@getautoplotspec into\nextplotspec % the space after ']' is required here: - % FIXME: + % FIXME: % - \addplot[]plot coordinates is NOT allowed!? \expandafter\pgfplots@addplotimpl\expandafter[\nextplotspec]% }% @@ -5164,7 +5205,7 @@ \begingroup% <-- This groups ends in \pgfplots@end@plot % \pgfplotsutil@ifnextchar c{% - \pgfplots@addplotimpl@coordinates{#1}{#2}plot + \pgfplots@addplotimpl@coordinates{#1}{#2}plot }{% \pgfplotsutil@ifnextchar f{% \pgfplots@addplotimpl@f{#1}{#2}% @@ -5230,7 +5271,7 @@ \long\def\pgfplots@addplotimpl@fillbetween@opt@#1#2#3#4{% \pgfkeysifdefined{/tikz/fill between/of/.@cmd}{% \pgfplotslibraryfillbetween@addplot{#1,#2}{#3}{#4}% - }{% + }{% \pgfplotsthrow{invalid argument} {\pgfplots@loc@TMPa}% {Please load \string\usepgfplotslibrary{fillbetween} in order to use `\string\addplot\space fill between'.}% @@ -5244,7 +5285,7 @@ % PRECONDITION: % the key-value sets have all been set in the current scope. -% +% % POSTCONDITION: % 1. the following macros are initialised and sanitized: % \pgfplots@plot@domain @@ -5259,9 +5300,9 @@ % /pgfplots/mesh/rows % /pgfplots/mesh/cols % /pgfplots/samples y (will contain a value ) -% 3. the macro -% \b@pgfplots@should@sample@LINE -% will be +% 3. the macro +% \b@pgfplots@should@sample@LINE +% will be % \def\b@pgfplots@should@sample@LINE{1} % if the expression plotter should sample a line % and @@ -5272,7 +5313,7 @@ \pgfkeysgetvalue{/pgfplots/samples y}\pgfplots@plot@samples@y \pgfkeysgetvalue{/pgfplots/samples at}\pgfplots@plot@samples@at \pgfkeysgetvalue{/pgfplots/variable y}\pgfplots@plot@var@y - % + % \ifx\pgfplots@plot@samples@y\pgfutil@empty \else \pgfplotscoordmath{default}{parse int}{\pgfplots@plot@samples@y}% @@ -5306,7 +5347,7 @@ \fi % % Check if we have to sample a line or a matrix. - % + % \pgfkeysgetvalue{/pgfplots/sample dim}\pgfplots@loc@TMPa \def\pgfplots@loc@TMPb{auto}% \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb @@ -5444,6 +5485,25 @@ \def\pgfplots@addplotimpl@expression@hasuniform@y{0}% % % + % + % if( + % x is logarithmic && + % #1 == '\x' && + % the 'samples at' key has not been used ) + % -> sample logarithmically! + \def\pgfplots@samples@logarithmically@x{0}% + \ifpgfplots@xislinear + \else + \if\pgfplots@addplotimpl@expression@hasuniform@x1% + \ifx\pgfplots@plot@samples@at\pgfutil@empty + % we don't have 'samples at' -> use domain! + \def\pgfplots@samples@logarithmically@x{1}% + \fi + \fi + \fi + % + \def\pgfplots@samples@logarithmically@y{0}% + % % Now, prepare the loops. % % I am using \pgfplotsforeachungrouped in favor of @@ -5460,15 +5520,6 @@ }% \pgfplots@addplotimpl@expression@split@yz#2\pgfplots@EOI% % - \ifx\pgfplots@plot@samples@at\pgfutil@empty - % we don't have 'samples at' -> use domain! - \expandafter\pgfplots@domain@to@foreach\pgfplots@plot@domain\relax{\pgfplots@plot@samples}% - \let\pgfplots@expression@xdomain=\pgfplotsretval - \else - % use 'samples at': - \let\pgfplots@expression@xdomain=\pgfplots@plot@samples@at - \fi - % % do we have '\y' as y coordinate? \expandafter\def\expandafter\pgfplots@loc@TMPb\expandafter{\pgfplots@plot@var@y}% \ifx\pgfplots@addplotimpl@expression@yEXPR\pgfplots@loc@TMPb @@ -5487,37 +5538,137 @@ \fi \fi % + \ifpgfplots@yislinear + \else + \if\pgfplots@addplotimpl@expression@hasuniform@y1% + \def\pgfplots@samples@logarithmically@y{1}% + \fi + \fi + % + \ifpgfplots@threedim@log@sampling + \else + \def\pgfplots@samples@logarithmically@x{0}% + \def\pgfplots@samples@logarithmically@y{0}% + \fi + % + \if\pgfplots@samples@logarithmically@x1% + \else + \ifx\pgfplots@plot@samples@at\pgfutil@empty + % we don't have 'samples at' -> use domain! + \expandafter\pgfplots@domain@to@foreach\pgfplots@plot@domain\relax{\pgfplots@plot@samples}% + \let\pgfplots@expression@xdomain=\pgfplotsretval + \else + % use 'samples at': + \let\pgfplots@expression@xdomain=\pgfplots@plot@samples@at + \fi + \fi + % + \if\pgfplots@samples@logarithmically@x1% + \if\pgfplots@samples@logarithmically@y1% + \pgfplots@warning{Sorry, 3d log sampling in BOTH x and y is not implemented yet}% + \def\pgfplots@samples@logarithmically@y{0}% + \fi + \fi % \if0\b@pgfplots@should@sample@LINE % Samples twodimensionally (a lattice): - \expandafter\pgfplots@domain@to@foreach\pgfplots@plot@ydomain\relax{\pgfplots@plot@samples@y}% - \let\pgfplots@expression@ydomain=\pgfplotsretval + \if\pgfplots@samples@logarithmically@y0% + \expandafter\pgfplots@domain@to@foreach\pgfplots@plot@ydomain\relax{\pgfplots@plot@samples@y}% + \let\pgfplots@expression@ydomain=\pgfplotsretval + \fi % - % Assemble a - % \pgfplots@plot@data##1 -> - % \foreach \y in {-5,-4.6,...,5} {##1}; - % \foreach \x in {-5,-4.6,...,5} + % Assemble a + % \pgfplots@plot@data##1 -> + % \foreach \y in {-5,-4.6,...,5} {##1}; + % \foreach \x in {-5,-4.6,...,5} % macro: - \edef\pgfplots@plot@data##1{% - \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\pgfplots@plot@var@y in {\pgfplots@expression@ydomain} - {% - \pgfplots@plot@data@notify@next@y - \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {% - \pgfplots@plot@data@notify@next@x - ##1% + \if\pgfplots@samples@logarithmically@x0% + \if\pgfplots@samples@logarithmically@y0% + % standard case: no log sampling. + \edef\pgfplots@plot@data##1{% + \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\pgfplots@plot@var@y in {\pgfplots@expression@ydomain} + {% + \pgfplots@plot@data@notify@next@y + \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {% + \pgfplots@plot@data@notify@next@x + ##1% + }% + \noexpand\pgfplotsplothandlernotifyscanlinecomplete + }% }% - \noexpand\pgfplotsplothandlernotifyscanlinecomplete - }% - }% + \fi + \fi + \if\pgfplots@samples@logarithmically@x1% + \if\pgfplots@samples@logarithmically@y0% + % sample logarithmically in X: + \edef\pgfplots@plot@data##1{% + \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\pgfplots@plot@var@y in {\pgfplots@expression@ydomain} + {% + \pgfplots@plot@data@notify@next@y + % + \noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots@plot@samples][x] + \expandafter\noexpand\tikz@plot@var/\noexpand\pgfplots@current@point@x@log + in {\pgfplots@plot@domain}% + {% + \pgfplots@plot@data@notify@next@x + ##1% + }% + \noexpand\pgfplotsplothandlernotifyscanlinecomplete + }% + }% + \fi + \fi + \if\pgfplots@samples@logarithmically@x0% + \if\pgfplots@samples@logarithmically@y1% + % sample logarithmically in Y: + \edef\pgfplots@plot@data##1{% + \noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots@plot@samples@y][y] + \expandafter\noexpand\pgfplots@plot@var@y/\noexpand\pgfplots@current@point@y@log + in {\pgfplots@plot@ydomain}% + {% + \pgfplots@plot@data@notify@next@y + \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {% + \pgfplots@plot@data@notify@next@x + ##1% + }% + \noexpand\pgfplotsplothandlernotifyscanlinecomplete + }% + }% + \fi + \fi + \if\pgfplots@samples@logarithmically@x1% + \if\pgfplots@samples@logarithmically@y1% + % sample logarithmically in X and Y: + % FIXME : IMPLEMENT! + % FIXME : implementation UNFINISHED: also support log + % sampling in BOTH 'x' 'y'! + % requires to solve FIXME in \pgfplotsforeachlogarithmicungrouped) + % -> also adopt unittest_log_sampling_3d.tex + % + \fi + \fi \else % sample a line: \def\pgfplots@plot@ydomain{0:0}% - \edef\pgfplots@plot@data##1{% - \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {% - \pgfplots@plot@data@notify@next@x - ##1% + \if\pgfplots@samples@logarithmically@x1% + % sample logarithmically: + \edef\pgfplots@plot@data##1{% + \noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots@plot@samples][x] + \expandafter\noexpand\tikz@plot@var/\noexpand\pgfplots@current@point@x@log + in {\pgfplots@plot@domain}% + {% + \pgfplots@plot@data@notify@next@x + ##1% + }% }% - }% + \else + \edef\pgfplots@plot@data##1{% + \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {% + \pgfplots@plot@data@notify@next@x + ##1% + }% + }% + \fi % % If we have (\x,\y,f(x)), use (\x,0,f(x)) instead and % suppress the error message which would occur for \y. @@ -5529,57 +5680,19 @@ \fi \fi \else - % Assemble a + % Assemble a % \pgfplots@plot@data##1 -> \foreach \x in {-5,-4.6,...,5} {##1} macro: - % - % - % if( - % x is logarithmic && - % #1 == '\x' && - % the 'samples at' key has not been used ) - % -> sample logarithmically! - \def\pgfplots@samples@logarithmically{0}% - \ifpgfplots@xislinear - \else - \if\pgfplots@addplotimpl@expression@hasuniform@x1% - \ifx\pgfplots@plot@samples@at\pgfutil@empty - % we don't have 'samples at' -> use domain! - \def\pgfplots@samples@logarithmically{1}% - \fi - \fi - \fi - \if\pgfplots@samples@logarithmically1% - \def\pgfplotsforeachlogarithmicmathid{x}% use \pgfplotscoordmath{x} + \if\pgfplots@samples@logarithmically@x1% % sample logarithmically: \edef\pgfplots@plot@data##1{% - \noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots@plot@samples] - \expandafter\noexpand\tikz@plot@var/\noexpand\pgfplots@current@point@x@log + \noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots@plot@samples][x] + \expandafter\noexpand\tikz@plot@var/\noexpand\pgfplots@current@point@x@log in {\pgfplots@plot@domain}% {% \pgfplots@plot@data@notify@next@x ##1% }% }% - % we have a logarithmic sampling sequence, - % \pgfplots@current@point@x@log is already available - % logarithmic! We can safe time and accuracy for the x - % coordinate by using that one instead of computing - % log(exp(\x)) numerically: - \pgfplots@disablelogfilter@xtrue - \def\pgfplots@addplotimpl@expression@prepare@x{% - \let\pgfplots@current@point@x=\pgfplots@current@point@x@log - }% - \pgflibraryfpuifactive - {\relax} - {% - % ok, if the FPU is NOT active, we should return - % results as fixed points. - % We need to configure that for - % \pgfplotsforeachlogarithmicungrouped manually: - \pgfplotsforeachlogarithmicformatresultwith{% - \pgfmathfloattofixed{\pgfmathresult}% - }% - }% \else \ifx\pgfplots@plot@samples@at\pgfutil@empty % we don't have 'samples at' -> use domain! @@ -5604,6 +5717,50 @@ \fi % % + \if\pgfplots@samples@logarithmically@x1% + % we have a logarithmic sampling sequence, + % \pgfplots@current@point@x@log is already available + % logarithmic! We can safe time and accuracy for the x + % coordinate by using that one instead of computing + % log(exp(\x)) numerically: + \pgfplots@disablelogfilter@xtrue + \def\pgfplots@addplotimpl@expression@prepare@x{% + \let\pgfplots@current@point@x=\pgfplots@current@point@x@log + }% + \pgflibraryfpuifactive + {\relax} + {% + % ok, if the FPU is NOT active, we should return + % results as fixed points. + % We need to configure that for + % \pgfplotsforeachlogarithmicungrouped manually: + \pgfplotsforeachlogarithmicformatresultwith{% + \pgfmathfloattofixed{\pgfmathresult}% + }% + }% + \fi + \if\pgfplots@samples@logarithmically@y1% + % we have a logarithmic sampling sequence, + % \pgfplots@current@point@y@log is already available + % logarithmic! We can safe time and accuracy for the y + % coordinate by using that one instead of computing + % log(exp(\y)) numerically: + \pgfplots@disablelogfilter@ytrue + \def\pgfplots@addplotimpl@expression@prepare@y{% + \let\pgfplots@current@point@y=\pgfplots@current@point@y@log + }% + \pgflibraryfpuifactive + {\relax} + {% + % ok, if the FPU is NOT active, we should return + % results as fixed points. + % We need to configure that for + % \pgfplotsforeachlogarithmicungrouped manually: + \pgfplotsforeachlogarithmicformatresultwith{% + \pgfmathfloattofixed{\pgfmathresult}% + }% + }% + \fi % START: % (NOTE: this does also define 'x', 'y', and 'z' math % expressions!) @@ -5724,7 +5881,7 @@ \expandafter\let\csname #3@max\endcsname=\pgfmathresult% }% \def\pgfplots@addplotimpl@expression@streamall{% - % create a backup of the 'x' and 'y' math expressions which + % create a backup of the 'x' and 'y' math expressions which % have been defined in \pgfplots@coord@stream@start: \let\pgfplots@addplotimpl@expression@pseudoconst@old@x=\pgfmathx@ \let\pgfplots@addplotimpl@expression@pseudoconst@old@y=\pgfmathy@ @@ -5758,7 +5915,7 @@ % negative arguments: % \x^3 ---> -0.2^3 but x^3 = (-0.2)^3 . % This does not happen for use fpu=true. - % + % \pgfplots@plot@data{% \let\pgfmathx@=\pgfplots@addplotimpl@expression@pseudoconst@x \let\pgfmathy@=\pgfplots@addplotimpl@expression@pseudoconst@y @@ -5918,7 +6075,7 @@ \let\pgfplots@backupof@pgfplotxyfile=\pgfplotxyfile -% the following code +% the following code % results finally in % % set format "%.7e";; set samples <...>; plot ... @@ -5973,7 +6130,7 @@ \ifx\pgfplots@gnuplot@dummy\pgfutil@empty \else \expandafter\pgfutil@in@\expandafter,\expandafter{\pgfplots@gnuplot@dummy}% - \ifpgfutil@in@ + \ifpgfutil@in@ \def\pgfplots@loc@TMPa##1,##2\pgfeov{\pgfplotsset{variable={##1},variable y={##2}}}% \else \def\pgfplots@loc@TMPa##1\pgfeov{\pgfplotsset{variable={##1}}}% @@ -6034,10 +6191,10 @@ set dummy \pgfplots@gnuplot@x\if0\b@pgfplots@should@sample@LINE,\pgfplots@gnuplot@y\fi; \ifx\pgfplots@gnuplot@logdirs\pgfutil@empty \else - set logscale \pgfplots@gnuplot@logdirs\space 2.71828182845905; + set logscale \pgfplots@gnuplot@logdirs\space 2.71828182845905; \fi \iftikz@plot@parametric set parametric;\fi - \ifpgfplots@curplot@threedim + \ifpgfplots@curplot@threedim \if0\b@pgfplots@should@sample@LINE % Samples twodimensionally (a lattice): % and the isosamples thing confuses me. @@ -6134,7 +6291,7 @@ \ifpgfplots@loop@CONTINUE % Now, invoke 'plot file'. % - % I invoke the private '@opt@' method because the semicolon ';' + % I invoke the private '@opt@' method because the semicolon ';' % character may cause problems due to catcode mismatches. % *sigh*. \pgfplots@addplotimpl@file@opt@@{}{}{#2}{#1}% this does not invoke the \pgfplots@start@plot@with@behavioroptions method. @@ -6159,7 +6316,7 @@ \pgfplots@gettikzinternal@keyval{prefix}{tikz@plot@prefix}{\jobname.}% \pgfplots@gettikzinternal@keyval{id}{tikz@plot@id}{pgf-shell}% % - \def\pgfplots@plot@filename{\tikz@plot@prefix\tikz@plot@id}% + \def\pgfplots@plot@filename{\tikz@plot@prefix\tikz@plot@id}% \def\pgfplots@plot@data{\pgfshell[\pgfplots@plot@filename]{#4}\pgfplotxyfile{\pgfplots@plot@filename.out}}% \def\pgfplotxyfile{\pgfplots@addplotimpl@shellresult{#5}}% \pgfplots@plot@data @@ -6180,7 +6337,7 @@ \ifpgfplots@loop@CONTINUE % Now, invoke 'plot file'. % - % I invoke the private '@opt@' method because the semicolon ';' + % I invoke the private '@opt@' method because the semicolon ';' % character may cause problems due to catcode mismatches. % *sigh*. \pgfplots@addplotimpl@file@opt@@{}{}{#2}{#1}% @@ -6312,7 +6469,7 @@ /pgfplots/filter discard warning=false, /pgfplots/mesh/rows=2,% allow \addplot[surf] graphics ... --> yields a good legend. /pgfplots/mesh/cols=2, - /pgfplots/mesh/check=false, + /pgfplots/mesh/check=false,% #1,/pgfplots/.cd,#2,% /pgfplots/plot graphics/@prepare legend, /pgfplots/plot graphics,% @@ -6380,7 +6537,7 @@ % automatically. % % Input options can be provided in '#2' using -% - column names, +% - column names, % for example '/pgfplots/table/x=firstcol' or just 'x=firstcol' % % - column indices, @@ -6395,14 +6552,14 @@ % \columnerrory, \columnerrorz % Provide access to the cell content which would be used without % 'expr'. -% The first three access the input coordinate columns, \meta the meta column -% (if any) and the last three the error data (if any). +% The first three access the input coordinate columns, \meta the meta column +% (if any) and the last three the error data (if any). % -% That means it is allowed to provide both, 'x' and 'x expr': +% That means it is allowed to provide both, 'x' and 'x expr': % 'x expr' can use the (old) value stored in 'x'. the final x % coordinate will be that returned of 'x expr'. % -% - \coordindex +% - \coordindex % % - \lineno (physical line numbers including comments etc) % @@ -6488,7 +6645,7 @@ \pgfplots@addplotimpl@table@fromstructure@prepareexpr@for{#1}{#3}{#4}% } -% Invokes `#1' if the command is invoked within +% Invokes `#1' if the command is invoked within % \addplot table {<\macro>}; % and `#2' if not. \def\pgfplotsifinaddplottablestruct#1#2{% @@ -6571,7 +6728,7 @@ \ifpgfplotslistempty \pgfplots@loop@CONTINUEfalse \else - % This here is just for sanity checking: if the 'y' column is + % This here is just for sanity checking: if the 'y' column is % - for whatever reasons - invalid; provide good error % recovery. \pgfplotslistcheckempty\addplot@tbl@y @@ -6671,7 +6828,7 @@ % PRECONDITION: % \pgfplots@plot@tbl@#1 contains the column name which would be used % if '#1 expr' is empty. -% +% % POSTCONDITION: % \pgfplots@plot@tbl@#1 will be CHANGED to use the 'expr' column (a % temporary name). @@ -6694,7 +6851,7 @@ \pgfkeysgetvalue{/pgfplots/table/#1 expr}{\pgfplots@loc@TMPa}% \ifx\pgfplots@loc@TMPa\pgfutil@empty \else - % get expression into register: + % get expression into register: \t@pgfplots@toka=\expandafter{\pgfplots@loc@TMPa}% % % @@ -7007,7 +7164,7 @@ \pgfplots@gettikzinternal@keyval{prefix}{tikz@plot@prefix}{\jobname.}% \pgfplots@gettikzinternal@keyval{id}{tikz@plot@id}{pgf-shell}% % - \def\pgfplots@plot@filename{\tikz@plot@prefix\tikz@plot@id}% + \def\pgfplots@plot@filename{\tikz@plot@prefix\tikz@plot@id}% \pgfshell[\pgfplots@plot@filename]{#3}\pgfplots@addplotimpl@table@fromfile{#1}{#2}{\pgfplots@plot@filename.out}#4;% }% @@ -7069,7 +7226,7 @@ % \numplotsofactualtype % Expands to the number of plots which have been seen in the current -% axis and which have the same type as the actual plot handler. +% axis and which have the same type as the actual plot handler. % % See also \plotnumofactualtype \def\pgfplots@numplotsofactualtype{% @@ -7095,6 +7252,7 @@ % \pgfplotssurveyphase@setactiveplothandlers % + \def\plotnum{\the\pgfplots@numplots}% \let\numplotsofactualtype=\pgfplots@numplotsofactualtype@duringplot % % Store this name during the \addplot command. Thus, even if the @@ -7400,7 +7558,7 @@ \fi }% -% Takes the current point (defined by a set of macros) as input and defines \pgf@x and \pgf@y +% Takes the current point (defined by a set of macros) as input and defines \pgf@x and \pgf@y % as the output point. It also defines % \pgfplots@current@point@x and its variants to contain the % transformed canvas coords (those which can be given to @@ -7484,14 +7642,14 @@ % Defines where to expect INPUT coordinates % \pgfplotspointgetcoordinatesfromnormalized[path=/data point/ -% would expect input coordinates +% would expect input coordinates % /data point/x % /data point/y % /data point/z \pgfkeyssetvalue{/pgfplots/coords/path}{/data point} % \pgfplotspointgetcoordinatesfromnormalized[target path=/data point/zero/ -% would write output coordinates +% would write output coordinates % /data point/zero/x % /data point/zero/y % /data point/zero/z @@ -7533,7 +7691,7 @@ \let#2=\pgfmathresult }% -% Defines an optimized and matching \pgfplotsaxisvisphasetransformcoordinate +% Defines an optimized and matching \pgfplotsaxisvisphasetransformcoordinate % during the coordinate finalization step in \end{axis}. \def\pgfplots@coord@stream@INIT@finalize@storedcoords@prepare@scaletrafomacro{% \begingroup @@ -7715,14 +7873,14 @@ % 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 +% 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. +% 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 @@ -7738,7 +7896,7 @@ \else \pgfplotspointplotattimegetfromcache{#1}% \ifpgfplots@loc@tmp - % CACHE HIT! + % CACHE HIT! %\message{CACHE HIT for \string\pgfplotspointplotattime{#1}^^J}% \else %\message{NO cache hit for \string\pgfplotspointplotattime{#1}^^J}% @@ -7879,9 +8037,9 @@ }% % A macro which is invoked whenever \pgfplotspointplotattime found a -% line segment. +% line segment. % -% INPUT: +% INPUT: % - \pgfplots@cur : serialized current point. This current point's % properties are available in the macros % \pgfplots@current@point@[xyz] etc. @@ -7969,7 +8127,7 @@ \fi }% -% INPUT: +% INPUT: % either floating point or fixed point coordinates (depending on the % state of the \ifpgfplots@apply@datatrafo boolean) % @@ -8047,7 +8205,7 @@ \fi }% - + % This routine is called at the begin of every plot. % It initialises a zero level stream. % @@ -8061,7 +8219,7 @@ % "draw zero level coordinates from list XYZ." % But at the time of this initialisation, the list will be EMPTY! % - % It will be filled later. That's ok, because + % It will be filled later. That's ok, because % \pgfplots@initzerolevelhandler will be % used as 'precommand', that means before Tikz sees any % coordinates. @@ -8184,7 +8342,7 @@ % \ifpgfplots@threedim % \pgfkeyslet{/pgfplots/axis/zero/z}\pgfplots@logical@ZERO@z % \fi - %-------------------------------------------------- + %-------------------------------------------------- }% @@ -8346,8 +8504,8 @@ }% % PRECONDITION: -% \pgfplotsplothandlergraphicspointmappointindex is -% empty if and only if (#4,#5) is empty +% \pgfplotsplothandlergraphicspointmappointindex is +% empty if and only if (#4,#5) is empty % or it is an index among all points with non--empty (#4,#5) image % coordinates. \def\pgfplotsplothandlergraphicspointmappoint(#1,#2,#3)(#4,#5){% @@ -8403,7 +8561,7 @@ % involved vectors). Thus, a simple approach is to provide 4 % linearly independend points to get 8 equations. % - % Then, I solve for o,e_x,e_y,e_z + % Then, I solve for o,e_x,e_y,e_z % \pgfplotsmatrixnewempty\pgfplotsmatrix \pgfplotsmatrixresize\pgfplotsmatrix88% @@ -8421,8 +8579,8 @@ \def\pgfplots@logical@z{##3}% }% % Assemble the linear system such that - % x = [ - % exx + % x = [ + % exx % exy % eyx % eyy @@ -8565,13 +8723,13 @@ \t@pgfplots@tokc=\expandafter{\pgfplots@loc@TMPa}% \immediate\write \if1\pgfplotsplothandlergraphicspointmapcomputerequiredview@debug 16\else -1\fi - {PGFPlots plot graphics[auto adjust axis=true] {\the\t@pgfplots@tokc} \csname on@line\endcsname: determined options '\pgfplotsretval'. + {PGFPlots plot graphics[auto adjust axis=true] {\the\t@pgfplots@tokc} \csname on@line\endcsname: determined options '\pgfplotsretval'. \if1\pgfplotsplothandlergraphicspointmapcomputerequiredview@debug See \the\t@pgfplots@tokc.dat for debug output. \else Use 'plot graphics[debug]' or 'plot graphics[debug=visual]' to generate debug output files. \fi - ^^J}% + ^^J}% \endgroup \fi % @@ -8700,9 +8858,9 @@ % DD_x / dd_x = W / w % DD_y / dd_y = H / h % - % where (W,H) is the natural size (i.e. in IMAGE coordinates) of the picture and + % where (W,H) is the natural size (i.e. in IMAGE coordinates) of the picture and % (w,h) is the size the picture will occupy in CANVAS coordinates. - % + % \pgfmath@basic@multiply@{\pgfplots@x@rel}{\pgfplots@W}% \let\pgfplots@w=\pgfmathresult % @@ -8825,7 +8983,7 @@ \pgfsetfillcolor{green}% \pgfpathcircle{\pgfplots@point@canvas}{2pt}% \pgfusepath{stroke,fill}% - \draw[->,red] + \draw[->,red] \pgfextra{ \pgfpathmoveto{\pgfplots@point@canvas@check}% \pgfpathlineto{\pgfplots@point@canvas}}; @@ -8846,8 +9004,8 @@ \pgfplots@error{Error using 'plot graphics': I got too few coordinates! I expected the lower left and upper right corners!}% \xdef\pgfplots@plot@handler@graphics@bb@first{\noexpand\pgfqpoint{0pt}{0pt}}% \xdef\pgfplots@plot@handler@graphics@bb@first{\noexpand\pgfqpoint{0pt}{0pt}}% - - \fi + + \fi \begingroup % determine the lower left / upper right corners. \pgfplots@plot@handler@graphics@bb@first |