%-------------------------------------------- % % Package pgfplots % % Provides a user-friendly interface to create function plots (normal % plots, semi-logplots and double-logplots). % % It is based on Till Tantau's PGF package. % % Copyright 2007/2008 by Christian Feuersänger. % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % %-------------------------------------------- % This file contains the code to process coordinates % - coordinate input: \addplot and its variants, % - coordinate loops, % - single coordinate processing % 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 % \pgfplotspointonorientedsurfaceA (one of the characters x,y or z) % and % \pgfplotspointonorientedsurfaceB. % The surface normal direction is % \pgfplotspointonorientedsurfaceN. % % Example: % \pgfplotspointonorientedsurfaceabsetupforxyz{0} % -> % \pgfplotspointonorientedsurfaceA = x % \pgfplotspointonorientedsurfaceB = y % \pgfplotspointonorientedsurfaceN = z % \pgfplotspointonorientedsurfaceab{3}{4} = \pgfqpointxyz{3}{4}{0} % % \pgfplotspointonorientedsurfaceabsetupforyxz{0} % -> % \pgfplotspointonorientedsurfaceA = y % \pgfplotspointonorientedsurfaceB = x % \pgfplotspointonorientedsurfaceN = z % \pgfplotspointonorientedsurfaceab{3}{4} = \pgfqpointxyz{4}{3}{0} % % @see \pgfplotspointonorientedsurfaceabsetupforxyz \def\pgfplotspointonorientedsurfaceab#1#2{% \pgfplots@error{Internal logic error: \string\pgfplotspointonorientedsurfaceab\ used although surface has not been declared! You need to call \string\pgfplotspointonorientedsurfaceabsetupforxyz\ or its friends to do so.}% }% % This macro will be defined after % \pgfplotspointonorientedsurfaceabsetupfor... % 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. % % The single characters can be one of % - 'a' - the corresponding axis is the PRIMARY direction of the % oriented surface. % - 'b' - the corresponding axis is the SECONDARY direction of the % oriented surface. % - anything else - the characters provides as second argument for % \pgfplotspointonorientedsurfaceabsetupforsetz{}{}, for example. % Common choices are '0' for lower limit, '1' for upper limit and % '2' for other. \def\pgfplotspointonorientedsurfacespec{}% % Similar to \pgfplotspointonorientedsurfacespec, this macro encodes % the currently active oriented surface. % However, it only contains the characters 'v', '0' and '1' and '2'. % The distinction 'v in {a,b}' is eliminated. \def\pgfplotspointonorientedsurfacespecunordered{}% % Initialises \pgfplotspointonorientedsurfaceab such that 'a' is the x % axis and 'b' is the y axis and the z coordinate has been fixed with % \pgfplotspointonorientedsurfaceabsetupforsetz{}. % % The Z value needs to be fixed with % \pgfplotspointonorientedsurfaceabsetupforsetz . % \def\pgfplotspointonorientedsurfaceabsetupforxyz{% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxyz{##1}{##2}{\pgfplotspointonorientedsurfaceabsetupfor@fixedZ}}% \def\pgfplotspointonorientedsurfaceA{x}% \def\pgfplotspointonorientedsurfaceB{y}% \def\pgfplotspointonorientedsurfaceN{z}% \edef\pgfplotspointonorientedsurfacespec{ab\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol}% \edef\pgfplotspointonorientedsurfacespecunordered{vv\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol}% }% \def\pgfplotspointonorientedsurfaceabsetupforyxz{% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxyz{##2}{##1}{\pgfplotspointonorientedsurfaceabsetupfor@fixedZ}}% \def\pgfplotspointonorientedsurfaceA{y}% \def\pgfplotspointonorientedsurfaceB{x}% \def\pgfplotspointonorientedsurfaceN{z}% \edef\pgfplotspointonorientedsurfacespec{ba\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol}% \edef\pgfplotspointonorientedsurfacespecunordered{vv\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol}% }% \def\pgfplotspointonorientedsurfaceabsetupforxzy{% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxyz{##1}{\pgfplotspointonorientedsurfaceabsetupfor@fixedY}{##2}}% \def\pgfplotspointonorientedsurfaceA{x}% \def\pgfplotspointonorientedsurfaceB{z}% \def\pgfplotspointonorientedsurfaceN{y}% \edef\pgfplotspointonorientedsurfacespec{a\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol b}% \edef\pgfplotspointonorientedsurfacespecunordered{v\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol v}% }% \def\pgfplotspointonorientedsurfaceabsetupforzxy{% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxyz{##2}{\pgfplotspointonorientedsurfaceabsetupfor@fixedY}{##1}}% \def\pgfplotspointonorientedsurfaceA{z}% \def\pgfplotspointonorientedsurfaceB{x}% \def\pgfplotspointonorientedsurfaceN{y}% \edef\pgfplotspointonorientedsurfacespec{b\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol a}% \edef\pgfplotspointonorientedsurfacespecunordered{v\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol v}% }% \def\pgfplotspointonorientedsurfaceabsetupforyzx{% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxyz{\pgfplotspointonorientedsurfaceabsetupfor@fixedX}{##1}{##2}}% \def\pgfplotspointonorientedsurfaceA{y}% \def\pgfplotspointonorientedsurfaceB{z}% \def\pgfplotspointonorientedsurfaceN{x}% \edef\pgfplotspointonorientedsurfacespec{\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol ab}% \edef\pgfplotspointonorientedsurfacespecunordered{\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol vv}% }% \def\pgfplotspointonorientedsurfaceabsetupforzyx{% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxyz{\pgfplotspointonorientedsurfaceabsetupfor@fixedX}{##2}{##1}}% \def\pgfplotspointonorientedsurfaceA{z}% \def\pgfplotspointonorientedsurfaceB{y}% \def\pgfplotspointonorientedsurfaceN{x}% \edef\pgfplotspointonorientedsurfacespec{\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol ba}% \edef\pgfplotspointonorientedsurfacespecunordered{\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol vv}% }% % Fixes 'x' to #1 for use in % \pgfplotspointonorientedsurfaceabsetupforzyx and % \pgfplotspointonorientedsurfaceabsetupforyzx. % % #1: The fixed value for 'x' (a coordinate in transformed range). % #2: a one-character symbol describing 'x'. % Command characters are % 0 : x is the lower x-axis range. % 1 : x is the upper x-axis range. % 2 : other. \def\pgfplotspointonorientedsurfaceabsetupforsetx#1#2{% \edef\pgfplotspointonorientedsurfaceabsetupfor@fixedX{#1}% \edef\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol{#2}% }% \def\pgfplotspointonorientedsurfaceabsetupforsety#1#2{% \edef\pgfplotspointonorientedsurfaceabsetupfor@fixedY{#1}% \edef\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol{#2}% }% \def\pgfplotspointonorientedsurfaceabsetupforsetz#1#2{% \edef\pgfplotspointonorientedsurfaceabsetupfor@fixedZ{#1}% \edef\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol{#2}% }% % Helper methods which should be used if no Z component exists (pure % 2d plots). \def\pgfplotspointonorientedsurfaceabsetupforxy{% \def\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol{0}% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxy{##1}{##2}}% \def\pgfplotspointonorientedsurfaceA{x}% \def\pgfplotspointonorientedsurfaceB{y}% \def\pgfplotspointonorientedsurfaceN{z}% \edef\pgfplotspointonorientedsurfacespec{ab\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol}% \edef\pgfplotspointonorientedsurfacespecunordered{vv\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol}% }% \def\pgfplotspointonorientedsurfaceabsetupforyx{% \def\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol{0}% \def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxy{##2}{##1}}% \def\pgfplotspointonorientedsurfaceA{y}% \def\pgfplotspointonorientedsurfaceB{x}% \def\pgfplotspointonorientedsurfaceN{z}% \edef\pgfplotspointonorientedsurfacespec{ba\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol}% \edef\pgfplotspointonorientedsurfacespecunordered{vv\pgfplotspointonorientedsurfaceabsetupfor@fixedsymbol}% }% % Assuming that an oriented surface has been initialised, say 'a0b', % we have the following possible axis lines which can be drawn: % - b=0: 'v00' % - b=1: 'v01' % - b=2: 'v02' % % To check which of them should be drawn, this macro here converts 'a' % to 'v' and 'b' to '#1'. % % The resulting three-character-string is written into '#2'. \def\pgfplotspointonorientedsurfaceabgetcontainedaxisline#1#2{% \expandafter\pgfplotspointonorientedsurfaceabgetcontainedaxisline@\pgfplotspointonorientedsurfacespec\relax{#1}% \let#2=\pgfplots@loc@TMPa }% % writes into \pgfplots@loc@TMPa: \def\pgfplotspointonorientedsurfaceabgetcontainedaxisline@#1#2#3\relax#4{% \pgfplotspointonorientedsurfaceabgetcontainedaxisline@single{#1}{#4}\to\pgfplots@loc@TMPa \pgfplotspointonorientedsurfaceabgetcontainedaxisline@single{#2}{#4}\to\pgfplots@loc@TMPb \pgfplotspointonorientedsurfaceabgetcontainedaxisline@single{#3}{#4}\to\pgfplots@loc@TMPc \edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa\pgfplots@loc@TMPb\pgfplots@loc@TMPc}% }% \def\pgfplotspointonorientedsurfaceabgetcontainedaxisline@single#1#2\to#3{% \if#1a% \def#3{v}% \else \if#1b% \def#3{#2}% \else \def#3{#1}% \fi \fi }% % Finds the two surfaces which are adjacent to an axis line encoded as % three-character-string. % % There are the following possibilities: % #1 = 'v**' where '*' is not 'v'. % -> #2 = 'vv*' and #3 = 'v*v' % % #1 = '*v*' % -> #2 = 'vv*' and #3 = '*vv' % % #1 = '**v' % -> #2 = 'v*v' and #3 = '*vv' \def\pgfplotsgetadjacentsurfsforaxisline#1\to#2#3{% \edef\pgfplots@loc@TMPa{#1}% \expandafter\pgfplotsgetadjacentsurfsforaxisline@\pgfplots@loc@TMPa\relax{#2}{#3}% }% \def\pgfplotsgetadjacentsurfsforaxisline@#1#2#3\relax#4#5{% \if#1v% \def#4{vv#3}% \def#5{v#2v}% \else \if#2v% \def#4{vv#3}% \def#5{#1vv}% \else \def#4{v#2v}% \def#5{#1vv}% \fi \fi }% % Executes code '#2' if the axis line with 'b=#1' on the current % oriented surface shall be drawn. % If that is not the case, the code '#3' will be executed. % % Example: % Let's assume the current oriented surface is 'b0a'. % Then, % \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn{0}{draw it!}{\relax} % will check whether the line '00v' shall be drawn while % \pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn{1}{draw it!}{\relax} % will check whether the line '10v' shall be drawn. % % @see \pgfplotspointonorientedsurfaceabgetcontainedaxisline % % @ATTENTION : this command will be always true for the 2D case. (it % will be overwritten, see \pgfplots@decide@which@figure@surfaces@are@drawn) \def\pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn#1#2#3{% \pgfplotspointonorientedsurfaceabgetcontainedaxisline#1\pgfplots@loc@TMPc \pgfplotsgetadjacentsurfsforaxisline\pgfplots@loc@TMPc\to\pgfplots@loc@TMPb\pgfplots@loc@TMPc \if1\csname pgfplots@surfenabled@\pgfplots@loc@TMPb\endcsname #2% \else \if1\csname pgfplots@surfenabled@\pgfplots@loc@TMPc\endcsname #2% \else #3% \fi \fi }% % Checks whether the line specified by a three-character-string '#1' % is inside of the currently set-up oriented surface. % % The return value is encoded as integer into the macro #2 as % described below. % % #1 : a three-character string uniquely identifing an axis line. % Each of the three characters can be 'v', '0' or '1'. % The value '0' denotes the lower axis range while '1' denotes % the upper axis range. The character 'v' stands for 'varying' % and indicates the direction in which the line varies. The first % character contains the values for the 'x' axis, the second % character for the 'y' axis and the third character for the 'z' % axis. % Example: % 'v01' is the axis line with 'y=lower y limit' and 'z=upper z limit' % '10v' is the axis line with 'x=upper x limit' and 'y=lower y limit' % The 'v' character indicates the varying component. There may be % only one 'v'. % #2 : a macro name. It will be empty if the line is NOT on the % current surface. If will be non-empty if it IS on the current % surface. % To be more precise, If the line IS on the current surface, '#2' will be set to % the character in '#1' which belongs to the second oriented % 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' % 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, % - '1' if the line IS on the surface and '#1' contains a '1' in % direction of the surface's 'b' axis. % No other values are possible. % % Example: % \pgfplotspointonorientedsurfaceabsetupforsetz{\zmax}{1} % \pgfplotspointonorientedsurfaceabsetupforyxz % \pgfplotspointonorientedsurfaceabmatchaxisline{v01}{\result} % -> \result will be 'v' because 'x=v' in '{v01} % % \pgfplotspointonorientedsurfaceabsetupforsety{\ymin}{0} % \pgfplotspointonorientedsurfaceabsetupforxzy % \pgfplotspointonorientedsurfaceabmatchaxisline{v01}{\result} % -> \result will be '1' because 'z=1' in '{v01} % % \pgfplotspointonorientedsurfaceabsetupforsety{\ymax}{1} % \pgfplotspointonorientedsurfaceabsetupforxzy % \pgfplotspointonorientedsurfaceabmatchaxisline{v01}{\result} % -> \result will be empty because 'y=0' in '{v01} % % \pgfplotspointonorientedsurfaceabsetupforsetx{\xmax}{1} % \pgfplotspointonorientedsurfaceabsetupforyzx % \pgfplotspointonorientedsurfaceabmatchaxisline{10v}{\result} % -> \result will be 'v' because 'z=v' in '{10v} \def\pgfplotspointonorientedsurfaceabmatchaxisline#1#2{% \pgfplotsmatchcubeparts{#1}{\pgfplotspointonorientedsurfacespec}{#2}% }% % Checks whether the line or surface specified by a three-character-string '#1' % is inside of the surface designated by the three-character-string '#2'. % % % Arguments: % #1 a cube-part (axis line or surface) encoded as three character % string. Can be '0v1' or 'vv0' or so (see above). % #2 a surface, also encoded as three character string. Maybe % oriented. % #3 The return value is encoded as integer into the macro #3 as % described in \pgfplotspointonorientedsurfaceabmatchaxisline: % '#3' will be EMPTY if '#1' is NOT in '#2'. % '#3' will be NON-EMPTY if '#1' IS in '#2'. \def\pgfplotsmatchcubeparts#1#2#3{% \edef\pgfplots@loc@TMPa{#1:#2}% \expandafter\pgfplotspointonorientedsurfaceabmatchaxisline@\pgfplots@loc@TMPa\pgfplots@EOI \let#3=\pgfplots@loc@TMPa }% % 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. % Input char oriented surface char % 'v' : is either a or b or v % '0' : is either 0, a, b, v or 2 (i.e. NOT 1) % '1' : is either 1, a, b, v or 2 (i.e. NOT 0) % That's all. % % If the 'oriented surface char' is 'v', then we actually don't have % an oriented surface but just a surface. % So, 'a0b' is the same surface as 'v0v', but the first choice has % designated orientations. % % @POST \pgfplots@loc@TMPa contains the return value macro. \def\pgfplotspointonorientedsurfaceabmatchaxisline@#1#2#3:#4#5#6\pgfplots@EOI{% % Search for the 'b' character: \if#4b% \def\pgfplots@loc@TMPa{#1}% \else \if#5b% \def\pgfplots@loc@TMPa{#2}% \else \if#6b% \def\pgfplots@loc@TMPa{#3}% \else \def\pgfplots@loc@TMPa{v}% FALLBACK solution. \fi \fi \fi % Now, check whether we need to clear the return value (i.e. % return false) \pgfplotspointonorientedsurfaceabmatchaxisline@single{#1}{#4}% \pgfplotspointonorientedsurfaceabmatchaxisline@single{#2}{#5}% \pgfplotspointonorientedsurfaceabmatchaxisline@single{#3}{#6}% } \def\pgfplotspointonorientedsurfaceabmatchaxisline@single#1#2{% \if#1v% \if#2a% \else \if#2b% \else \if#2v% \else \let\pgfplots@loc@TMPa=\pgfutil@empty \fi \fi \fi \else \if0#1% \if1#2% \let\pgfplots@loc@TMPa=\pgfutil@empty \fi \else \if1#1% \if0#2% \let\pgfplots@loc@TMPa=\pgfutil@empty \fi \else \pgfplots@error{The character '#1' is no valid element for a three-character axis line or surface description!}% \fi \fi \fi }% % Takes Pitch '#1' and Yaw '#2' (both in degrees) and computes % x,y and z vectors which define the view in the direction % defined by '#1' and '#2'. % % 'Pitch' means a rotation around the viewport's x axis. 'Yaw' means % a rotation around the original coordinate system's z axis. % % The method works by computing % Az = [ cos(yaw) -sin(yaw) 0; ... % sin(yaw) cos(yaw) 0; ... % 0 0 1 ]; % Ax = [ 1 0 0; ... % 0 cos(pitch) -sin(pitch) ;... % 0 sin(pitch) cos(pitch) ]; % v= Ax * Az; % % = [ ... % cosy -siny cosp siny sinp; ... % siny cosy cosp -sinp cosy; ... % 0 sinp cosp ]; % % Then, we use the rotated XY plane as viewport, that means % xvec = v * [1 0 0]' % yvec = v * [0 1 0]' % and we define the projection onto the twodimensional surface % spanned by 'xvec' and 'yvec' as % P( q ) = [ q^T xvec, q^T yvec ]' % for q in R^3. % As a consequence, we compute the three unit vectors as % x = P( [1 0 0] ) % y = P( [0 1 0] ) % z = P( [0 0 1] ) % and get thus in matlab notation: % % proj = 1:2; % x = v(1,proj); % y = v(2,proj); % z = v(3,proj); % % INPUT: % - #1 : pitch % - #2 : yaw % OUTPUT: % - #3 : a macro which will be set to '1' if and only if % the viewport is the standard XY axis (i.e. pitch=0,yaw=0). % - [xyz] vectors, % \pgfplots@[xyz]@veclength, % \pgfplots@[xyz]@inverseveclength % are set properly \def\pgfplotssetaxesfrompitchyaw#1#2#3{% \begingroup \pgfmathsin@{#1}% \let\sinp=\pgfmathresult \pgfmathsin@{#2}% \let\siny=\pgfmathresult \pgfmathcos@{#1}% \let\cosp=\pgfmathresult \pgfmathcos@{#2}% \let\cosy=\pgfmathresult % x: \pgfmathmultiply@{\siny}{-1}% \expandafter\pgfmathmultiply@\expandafter{\pgfmathresult}{\cosp}% \xdef\pgfplots@glob@TMPa{\noexpand\pgfqpoint{\cosy pt}{\pgfmathresult pt}}% % y: \pgfmathmultiply@{\cosy}{\cosp}% \xdef\pgfplots@glob@TMPb{\noexpand\pgfqpoint{\siny pt}{\pgfmathresult pt}}% % z: \xdef\pgfplots@glob@TMPc{\noexpand\pgfqpoint{0pt}{\sinp pt}}% \endgroup \message{Setting x,y and z from {#1}{#2} to x = \meaning\pgfplots@glob@TMPa, y = \meaning\pgfplots@glob@TMPb, z = \meaning\pgfplots@glob@TMPc...}% \pgfsetxvec{\pgfplots@glob@TMPa}% \pgfsetyvec{\pgfplots@glob@TMPb}% \pgfsetzvec{\pgfplots@glob@TMPc}% \def#3{0}% \def\pgfplots@x@veclength{1.0}% \def\pgfplots@y@veclength{1.0}% \def\pgfplots@z@veclength{1.0}% \def\pgfplots@x@inverseveclength{1.0}% \def\pgfplots@y@inverseveclength{1.0}% \def\pgfplots@z@inverseveclength{1.0}% \iftrue \pgfplots@scaleaxes@to@BB{\pgfplots@width}{\pgfplots@height}% FIXME : width and height is wrong: labels missing \else % FIXME : \def\pgfplots@x@veclength{200}% \pgfmathreciprocal@{\pgfplots@x@veclength}% \let\pgfplots@x@inverseveclength=\pgfmathresult \def\pgfplots@y@veclength{200}% \pgfmathreciprocal@{\pgfplots@y@veclength}% \let\pgfplots@y@inverseveclength=\pgfmathresult \def\pgfplots@z@veclength{200}% \pgfmathreciprocal@{\pgfplots@z@veclength}% \let\pgfplots@z@inverseveclength=\pgfmathresult \pgfsetxvec{\pgfpointscale{\pgfplots@x@veclength}{\pgfplots@glob@TMPa}}% \pgfsetyvec{\pgfpointscale{\pgfplots@y@veclength}{\pgfplots@glob@TMPb}}% \pgfsetzvec{\pgfpointscale{\pgfplots@z@veclength}{\pgfplots@glob@TMPc}}% \fi \message{After scaling: x = (\the\pgf@xx,\the\pgf@xy), y = (\the\pgf@yx,\the\pgf@yy), z = (\the\pgf@zx,\the\pgf@zy).}% }% % Takes the current PGF x,y and z unit vectors and scales them such % that the bounding box of the final image has width #1 and height #2. % % The length of the input vectors is important for the 3D case: it % will be scaled as-is. % % PRECONDITION % - the x, y and z unit vectors have been set to the proper % DIRECTIONS. Their relative vector lengths are set-up properly % (i.e. y is twice as large as x and half as large as z or so). % - \pgfplots@[xyz]@veclength and % \pgfplots@[xyz]@inverseveclength % are set correctly. % - the \ifpgfplots@threedim boolean is set. % - the data limits have been initialised and transformed according % to the data transformation. % % POSTCONDITION % - the unit vectors have been re-scaled such that the final plot % has the desired dimensions. % - the @veclength and @inverseveclength have been re-scaled as % well. \def\pgfplots@scaleaxes@to@BB#1#2{% \begingroup \pgfinterruptboundingbox % STEP 1: compute the bounding box for UNITS: \ifpgfplots@threedim \pgfpathmoveto{\pgfqpointxyz000}% \pgfpathmoveto{\pgfqpointxyz001}% \pgfpathmoveto{\pgfqpointxyz010}% \pgfpathmoveto{\pgfqpointxyz011}% \pgfpathmoveto{\pgfqpointxyz100}% \pgfpathmoveto{\pgfqpointxyz101}% \pgfpathmoveto{\pgfqpointxyz110}% \pgfpathmoveto{\pgfqpointxyz111}% \else \pgfpathmoveto{\pgfqpointxy00}% \pgfpathmoveto{\pgfqpointxy01}% \pgfpathmoveto{\pgfqpointxy10}% \pgfpathmoveto{\pgfqpointxy11}% \fi % TMPa = width \pgf@xa=\pgf@pathmaxx \advance\pgf@xa by-\pgf@pathminx % TMPb = height \pgf@xb=\pgf@pathmaxy \advance\pgf@xb by-\pgf@pathminy \pgf@ya=#1\relax \pgf@yb=#2\relax \message{PGFPLOTS: the current unit vectors result in a UNIT BB of (\the\pgf@xa,\the\pgf@xb). Scaling it to (\the\pgf@ya,\the\pgf@yb)...}% % STEP 2: compute the scales for x and y such % that the UNIT-BB will have size #1,#2: \pgfplotsutil@edef@invoke\pgfmathdivide@{% {\pgf@sys@tonumber\pgf@ya}% {\pgf@sys@tonumber\pgf@xa}% }% % TMPa = scalex \global\let\pgfplots@glob@TMPa=\pgfmathresult \pgfplotsutil@edef@invoke\pgfmathdivide@{% {\pgf@sys@tonumber\pgf@yb}% {\pgf@sys@tonumber\pgf@xb}% }% % TMPb = scaley \global\let\pgfplots@glob@TMPb=\pgfmathresult \pgfusepath{discard}% \endpgfinterruptboundingbox \endgroup \message{got scalex = \pgfplots@glob@TMPa\space and scaley = \pgfplots@glob@TMPb.}% \pgfmathsubtract@{\pgfplots@xmax}{\pgfplots@xmin}% \expandafter\pgfmathreciprocal@\expandafter{\pgfmathresult}% \message{and 1/(xmax-xmin) = 1/(\pgfplots@xmax-\pgfplots@xmin) = \pgfmathresult.}% \pgf@xx=\pgfplots@glob@TMPa\pgf@xx \pgf@xy=\pgfplots@glob@TMPb\pgf@xy \pgf@xx=\pgfmathresult\pgf@xx \pgf@xy=\pgfmathresult\pgf@xy % \pgfmathsubtract@{\pgfplots@ymax}{\pgfplots@ymin}% \expandafter\pgfmathreciprocal@\expandafter{\pgfmathresult}% \message{and 1/(ymay-ymin) = 1/(\pgfplots@ymax-\pgfplots@ymin) = \pgfmathresult.}% \pgf@yx=\pgfplots@glob@TMPa\pgf@yx \pgf@yy=\pgfplots@glob@TMPb\pgf@yy \pgf@yx=\pgfmathresult\pgf@yx \pgf@yy=\pgfmathresult\pgf@yy % \ifpgfplots@threedim \pgfmathsubtract@{\pgfplots@zmax}{\pgfplots@zmin}% \expandafter\pgfmathreciprocal@\expandafter{\pgfmathresult}% \message{and 1/(zmaz-zmin) = 1/(\pgfplots@zmax-\pgfplots@zmin) = \pgfmathresult.}% \pgf@zx=\pgfplots@glob@TMPa\pgf@zx \pgf@zy=\pgfplots@glob@TMPb\pgf@zy \pgf@zx=\pgfmathresult\pgf@zx \pgf@zy=\pgfmathresult\pgf@zy \fi \pgfplots@computeunitvectorlengths }% \def\pgfplots@computeunitvectorlengths{% \pgfplotsutil@edef@invoke\pgfmathveclen@{% {\pgf@sys@tonumber\pgf@xx}% {\pgf@sys@tonumber\pgf@xy}% }% \let\pgfplots@x@veclength=\pgfmathresult \expandafter\pgfmathreciprocal@\expandafter{\pgfmathresult}% \let\pgfplots@x@inverseveclength=\pgfmathresult % \pgfplotsutil@edef@invoke\pgfmathveclen@{% {\pgf@sys@tonumber\pgf@yx}% {\pgf@sys@tonumber\pgf@yy}% }% \let\pgfplots@y@veclength=\pgfmathresult \expandafter\pgfmathreciprocal@\expandafter{\pgfmathresult}% \let\pgfplots@y@inverseveclength=\pgfmathresult % \ifpgfplots@threedim \pgfplotsutil@edef@invoke\pgfmathveclen@{% {\pgf@sys@tonumber\pgf@zx}% {\pgf@sys@tonumber\pgf@zy}% }% \let\pgfplots@z@veclength=\pgfmathresult \expandafter\pgfmathreciprocal@\expandafter{\pgfmathresult}% \let\pgfplots@z@inverseveclength=\pgfmathresult \fi }% % Internal stream methods. % % Please overwrite % - \pgfplots@coord@stream@start@, % - \pgfplots@coord@stream@end@ and % - \pgfplots@coord@stream@coord@ % if you implement streams. % % REMARK: % - the stream methods automatically collect first and last % coordinates. % - I have experimented with global \addplot accumulation to reduce % copy operations. That experiment was not successfull (it was not % faster :-( ). However, the streaming methods still assign their % things globally... \newif\ifpgfplots@coord@stream@isfirst \def\pgfplots@coord@stream@start{% \global\pgfplots@coord@stream@isfirsttrue \global\let\pgfplots@currentplot@firstcoord@x=\pgfutil@empty \global\let\pgfplots@currentplot@firstcoord@y=\pgfutil@empty \global\let\pgfplots@currentplot@firstcoord@z=\pgfutil@empty \global\let\pgfplots@currentplot@lastcoord@x=\pgfutil@empty \global\let\pgfplots@currentplot@lastcoord@y=\pgfutil@empty \global\let\pgfplots@currentplot@lastcoord@z=\pgfutil@empty \let\pgfplots@current@point@x=\pgfutil@empty \let\pgfplots@current@point@y=\pgfutil@empty \let\pgfplots@current@point@z=\pgfutil@empty \let\pgfplots@current@point@meta=\pgfutil@empty \let\pgfplots@current@point@x@error=\pgfutil@empty \let\pgfplots@current@point@y@error=\pgfutil@empty \let\pgfplots@current@point@z@error=\pgfutil@empty \pgfplots@coord@stream@start@}% \def\pgfplots@coord@stream@end{\pgfplots@coord@stream@end@} % Will be invoked for every point coordinate. % % It invokes \pgfplots@coord@stream@coord@. % % Arguments: % \pgfplots@current@point@[xyz] % \pgfplots@current@point@[xyz]@error (if in argument list) % \pgfplots@current@point@meta \def\pgfplots@coord@stream@coord{% \pgfplots@coord@stream@coord@% % FIXME : needs to be updated for 3D % FIXME : reduce \if's \ifx\pgfplots@current@point@x\pgfutil@empty \else \ifx\pgfplots@current@point@y\pgfutil@empty \else \ifpgfplots@coord@stream@isfirst \global\let\pgfplots@currentplot@firstcoord@x=\pgfplots@current@point@x \global\let\pgfplots@currentplot@firstcoord@y=\pgfplots@current@point@y \global\pgfplots@coord@stream@isfirstfalse \fi \global\let\pgfplots@currentplot@lastcoord@x=\pgfplots@current@point@x \global\let\pgfplots@currentplot@lastcoord@y=\pgfplots@current@point@y \fi \fi }% % Initialises % \pgfplots@coord@stream@start % \pgfplots@coord@stream@coord % \pgfplots@coord@stream@end % such that a following coordinate stream is processed properly. The % following coordinate stream may come from different input methods. % % Arguments: % #1: all options of \addplot[...] (the plot style) % #2: any trailing path commands after the 'plot' command as such, % for example \addplot plot coordinates {...} -- (0,0); % would yield #2 =' -- (0,0)' % % PRECONDITION: % - needs to be called inside of \addplot. % % REMARK: % The following code is permissable: % \pgfplots@PREPARE@COORD@STREAM{..}{...} % \pgfplots@coord@stream@start % ... % \pgfplots@coord@stream@coord % .. % \pgfplots@coord@stream@coord % .. % \pgfplots@coord@stream@end % -> All need to be the SAME LEVEL OF SCOPING! The '@coord' commands % may not be scoped deeper than 'begin' and 'end'! % - I had a version which allowed that. it was actually slower! % - For now, the following things are global / local: % - point coordinate list: local % - meta data limits: global, % - recorded error bar commands: local, % - what about stacked plot stuff: appears to be a combination % of local/global. % \long\def\pgfplots@PREPARE@COORD@STREAM#1#2{% \ifpgfplots@curplot@threedim \global\pgfplots@threedimtrue \fi \def\pgfplots@coord@stream@start@{% \pgfplotsapplistXXnewempty \ifpgfplots@errorbars@enabled \pgfplots@streamerrorbar@recordto{\pgfplots@recordederrorbar}% \pgfplots@streamerrorbarstart \else \let\pgfplots@recordederrorbar=\pgfutil@empty \fi \ifpgfplots@stackedmode \pgfplots@stacked@beginplot \fi % %\let\pgfplots@coord@stream@recorded=\pgfutil@empty % \pgfplots@perpointmeta@usesfloattrue % %%%%%%%%%%%%%% % % Define \pgfplots@set@perpointmeta properly: \ifcase\pgfplots@perpointmeta@choice % disabled. \def\pgfplots@set@perpointmeta{% \let\pgfplots@current@point@meta=\pgfutil@empty }% \or % point meta/x \def\pgfplots@set@perpointmeta{% \let\pgfplots@current@point@meta=\pgfplots@current@point@x }% \ifpgfplots@xislinear \else \pgfplots@perpointmeta@usesfloatfalse \fi \or % point meta/y \def\pgfplots@set@perpointmeta{% \let\pgfplots@current@point@meta=\pgfplots@current@point@y }% \ifpgfplots@yislinear \else \pgfplots@perpointmeta@usesfloatfalse \fi \or % point meta/z \def\pgfplots@set@perpointmeta{% \let\pgfplots@current@point@meta=\pgfplots@current@point@z }% \ifpgfplots@zislinear \else \pgfplots@perpointmeta@usesfloatfalse \fi \or % point meta/explicit : parse the information found % somewhere: \def\pgfplots@set@perpointmeta{% \ifx\pgfplots@current@point@meta\pgfutil@empty \else \pgfmathfloatparsenumber{\pgfplots@current@point@meta}% \fi \let\pgfplots@current@point@meta=\pgfmathresult }% \or % point meta/explicit symbolic : simply collect the % information, no math. \def\pgfplots@set@perpointmeta{}% \fi \ifnum\pgfplots@perpointmeta@choice=0 \global\let\pgfplots@metamin=\pgfutil@empty \global\let\pgfplots@metamax=\pgfutil@empty \else \ifnum\pgfplots@perpointmeta@choice=5 \global\let\pgfplots@metamin=\pgfutil@empty \global\let\pgfplots@metamax=\pgfutil@empty \else % We need to work with per point meta data. % So, also compute the data range on a per-stream basis! % These limits are important later. \ifpgfplots@perpointmeta@usesfloat \pgfmathfloatcreate{1}{1.0}{2147483645}% \let\pgfplots@invalidrange@metamin=\pgfmathresult \pgfmathfloatcreate{2}{1.0}{2147483645}% \let\pgfplots@invalidrange@metamax=\pgfmathresult \global\let\pgfplots@metamin=\pgfplots@invalidrange@metamin \global\let\pgfplots@metamax=\pgfplots@invalidrange@metamax \expandafter\def\expandafter\pgfplots@set@perpointmeta\expandafter{% \pgfplots@set@perpointmeta \ifx\pgfplots@current@point@meta\pgfutil@empty \else \pgfplotsmathfloatmin{\pgfplots@metamin}{\pgfplots@current@point@meta}% \global\let\pgfplots@metamin=\pgfmathresult \pgfplotsmathfloatmax{\pgfplots@metamax}{\pgfplots@current@point@meta}% \global\let\pgfplots@metamax=\pgfmathresult \fi }% \else \def\pgfplots@invalidrange@metamin{16300}% \def\pgfplots@invalidrange@metamax{-16300}% \global\let\pgfplots@metamin=\pgfplots@invalidrange@metamin \global\let\pgfplots@metamax=\pgfplots@invalidrange@metamax \expandafter\def\expandafter\pgfplots@set@perpointmeta\expandafter{% \pgfplots@set@perpointmeta \ifx\pgfplots@current@point@meta\pgfutil@empty \else \pgfplotsmathmin{\pgfplots@metamin}{\pgfplots@current@point@meta}% \global\let\pgfplots@metamin=\pgfmathresult \pgfplotsmathmax{\pgfplots@metamax}{\pgfplots@current@point@meta}% \global\let\pgfplots@metamax=\pgfmathresult \fi }% \fi \fi \fi }% \begingroup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \let\E=\noexpand % % Setup Just-In-Time-Macro Compilation: % I compile a set of macros which is highly optimized for this % particular plot. % % 1.\pgfplots@update@limits@for@one@point % Updates the current x and y limits for point (#1,#2). % % To eliminate all those case distinctions, it is created with % 'edef' and a lot of '\noexpand' calls here: % % % The point coordinates may be given in floating point format, see % below. % % Please note that if user specified limits are given, automatic % limits are only applied to points which fall into the user specified % clipping region. % % PRECONDITIONS: % - the input coordinates have been parsed correctly (floating point % format for linear axis, log applied for logarithmic ones) % % Arguments: % \pgfplots@current@point@[xyz] \xdef\pgfplots@update@limits@for@one@point{% %\E\tracingmacros=2\E\tracingcommands=2 %\E\pgfplots@message{Updating limits for (\E\pgfplots@current@point@x,\E\pgfplots@current@point@y) ...}% % % VIM SEARCH PATTERN: % [^E]\zs\\\ze[^E] % -> this finds '\' which is neither '\E' nor is it prefixed % by 'E'. % % % \E\pgfplots@update@limits@for@one@point@ISCLIPPEDfalse % check whether we need to clip limits: \ifpgfplots@clip@limits \ifpgfplots@autocompute@xmin \else \ifpgfplots@xislinear \E\pgfmathfloatlessthan@{\E\pgfplots@current@point@x}{\E\pgfplots@xmin}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \else \E\pgfplotsmathlessthan{\E\pgfplots@current@point@x}{\E\pgfplots@xmin}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \fi \fi \ifpgfplots@autocompute@xmax \else \ifpgfplots@xislinear \E\pgfmathfloatlessthan@{\E\pgfplots@xmax}{\E\pgfplots@current@point@x}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \else \E\pgfplotsmathlessthan{\E\pgfplots@xmax}{\E\pgfplots@current@point@x}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \fi \fi \ifpgfplots@autocompute@ymin \else \ifpgfplots@yislinear \E\pgfmathfloatlessthan@{\E\pgfplots@current@point@y}{\E\pgfplots@ymin}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \else \E\pgfplotsmathlessthan{\E\pgfplots@current@point@y}{\E\pgfplots@ymin}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \fi \fi \ifpgfplots@autocompute@ymax \else \ifpgfplots@yislinear \E\pgfmathfloatlessthan@{\E\pgfplots@ymax}{\E\pgfplots@current@point@y}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \else \E\pgfplotsmathlessthan{\E\pgfplots@ymax}{\E\pgfplots@current@point@y}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \fi \fi \ifpgfplots@curplot@threedim \else \ifpgfplots@autocompute@zmin \else \ifpgfplots@zislinear \E\pgfmathfloatlessthan@{\E\pgfplots@current@point@z}{\E\pgfplots@zmin}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \else \E\pgfplotsmathlessthan{\E\pgfplots@current@point@z}{\E\pgfplots@zmin}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \fi \fi \ifpgfplots@autocompute@zmax \else \ifpgfplots@zislinear \E\pgfmathfloatlessthan@{\E\pgfplots@zmax}{\E\pgfplots@current@point@z}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \else \E\pgfplotsmathlessthan{\E\pgfplots@zmax}{\E\pgfplots@current@point@z}% \E\ifpgfmathfloatcomparison \E\pgfplots@update@limits@for@one@point@ISCLIPPEDtrue \E\fi \fi \fi \fi \fi % % % % Update limits: \E\ifpgfplots@update@limits@for@one@point@ISCLIPPED \E\else \ifpgfplots@autocompute@xmin \ifpgfplots@xislinear \E\pgfplotsmathfloatmin{\E\pgfplots@xmin}{\E\pgfplots@current@point@x}% \E\global\E\let\E\pgfplots@xmin=\E\pgfmathresult \else \E\pgfplotsmathmin{\E\pgfplots@xmin}{\E\pgfplots@current@point@x}% \E\global\E\let\E\pgfplots@xmin=\E\pgfmathresult \fi \fi \ifpgfplots@autocompute@xmax \ifpgfplots@xislinear \E\pgfplotsmathfloatmax{\E\pgfplots@xmax}{\E\pgfplots@current@point@x}% \E\global\E\let\E\pgfplots@xmax=\E\pgfmathresult \else \E\pgfplotsmathmax{\E\pgfplots@xmax}{\E\pgfplots@current@point@x}% \E\global\E\let\E\pgfplots@xmax=\E\pgfmathresult \fi \fi \ifpgfplots@autocompute@ymin \ifpgfplots@yislinear \E\pgfplotsmathfloatmin{\E\pgfplots@ymin}{\E\pgfplots@current@point@y}% \E\global\E\let\E\pgfplots@ymin=\E\pgfmathresult \else \E\pgfplotsmathmin{\E\pgfplots@ymin}{\E\pgfplots@current@point@y}% \E\global\E\let\E\pgfplots@ymin=\E\pgfmathresult \fi \fi \ifpgfplots@autocompute@ymax \ifpgfplots@yislinear \E\pgfplotsmathfloatmax{\E\pgfplots@ymax}{\E\pgfplots@current@point@y}% \E\global\E\let\E\pgfplots@ymax=\E\pgfmathresult \else \E\pgfplotsmathmax{\E\pgfplots@ymax}{\E\pgfplots@current@point@y}% \E\global\E\let\E\pgfplots@ymax=\E\pgfmathresult \fi \fi \ifpgfplots@curplot@threedim \ifpgfplots@autocompute@zmin \ifpgfplots@zislinear \E\pgfplotsmathfloatmin{\E\pgfplots@zmin}{\E\pgfplots@current@point@z}% \E\global\E\let\E\pgfplots@zmin=\E\pgfmathresult \else \E\pgfplotsmathmin{\E\pgfplots@zmin}{\E\pgfplots@current@point@z}% \E\global\E\let\E\pgfplots@zmin=\E\pgfmathresult \fi \fi \ifpgfplots@autocompute@zmax \ifpgfplots@zislinear \E\pgfplotsmathfloatmax{\E\pgfplots@zmax}{\E\pgfplots@current@point@z}% \E\global\E\let\E\pgfplots@zmax=\E\pgfmathresult \else \E\pgfplotsmathmax{\E\pgfplots@zmax}{\E\pgfplots@current@point@z}% \E\global\E\let\E\pgfplots@zmax=\E\pgfmathresult \fi \fi \fi \E\fi % % Compute data range: \ifpgfplots@autocompute@all@limits % the data range will be acquired simply from the axis % range, see below! \else % Attention: it is only done for linear axis! \ifpgfplots@xislinear \E\pgfplotsmathfloatmin{\E\pgfplots@data@xmin}{\E\pgfplots@current@point@x}% \E\global\E\let\E\pgfplots@data@xmin=\E\pgfmathresult \E\pgfplotsmathfloatmax{\E\pgfplots@data@xmax}{\E\pgfplots@current@point@x}% \E\global\E\let\E\pgfplots@data@xmax=\E\pgfmathresult \fi \ifpgfplots@yislinear \E\pgfplotsmathfloatmin{\E\pgfplots@data@ymin}{\E\pgfplots@current@point@y}% \E\global\E\let\E\pgfplots@data@ymin=\E\pgfmathresult \E\pgfplotsmathfloatmax{\E\pgfplots@data@ymax}{\E\pgfplots@current@point@y}% \E\global\E\let\E\pgfplots@data@ymax=\E\pgfmathresult \fi \ifpgfplots@curplot@threedim \ifpgfplots@zislinear \E\pgfplotsmathfloatmin{\E\pgfplots@data@zmin}{\E\pgfplots@current@point@z}% \E\global\E\let\E\pgfplots@data@zmin=\E\pgfmathresult \E\pgfplotsmathfloatmax{\E\pgfplots@data@zmax}{\E\pgfplots@current@point@z}% \E\global\E\let\E\pgfplots@data@zmax=\E\pgfmathresult \fi \fi \fi %\E\pgfplots@message{Updated limits: (\E\pgfplots@xmin,\E\pgfplots@ymin) rectangle (\E\pgfplots@xmax,\E\pgfplots@ymax).}% %\E\tracingmacros=0\E\tracingcommands=0 }% %\message{Assembled update-limits macro to {\meaning\pgfplots@update@limits@for@one@point}}% \ifpgfplots@bb@isactive \else % we are inside of % \pgfplotsinterruptdatabb % .. % \endpgfinterruptboundingbox % -> don't change data limits! \global\let\pgfplots@update@limits@for@one@point=\relax \fi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This here is the MAIN code of \pgfplots@process@one@point . % It is inserted below into the right, into one of two prepared % places. \def\pgfplots@loc@TMPa{% \ifpgfplots@apply@datatrafo \ifpgfplots@datascaletrafo@initialised % apply data transformation directly. \ifpgfplots@apply@datatrafo@x \E\pgfplots@datascaletrafo@x\E\pgfplots@current@point@x \E\let\E\pgfplots@current@point@x=\E\pgfmathresult \fi \ifpgfplots@apply@datatrafo@y \E\pgfplots@datascaletrafo@y\E\pgfplots@current@point@y \E\let\E\pgfplots@current@point@y=\E\pgfmathresult \fi \ifpgfplots@curplot@threedim \ifpgfplots@apply@datatrafo@z \E\pgfplots@datascaletrafo@z\E\pgfplots@current@point@z \E\let\E\pgfplots@current@point@z=\E\pgfmathresult \fi \fi \fi \fi % All following routines (limit updating/stacking/error % bars) will use float numerics if necessary (controlled % by ifs). \ifpgfplots@stackedmode \E\pgfplots@stacked@preparepoint@inmacro% \ifpgfplots@datascaletrafo@initialised% is also true if there is no scale trafo. \E\pgfplots@stacked@finishpoint \else % the finishpoint routine will be invoked at % \endaxis. \fi \fi % % Prepare \pgfplots@current@point@meta (see the preparation % routine above): \E\pgfplots@set@perpointmeta % % update also axis / data limits: % Arguments: \pgfplots@current@point@[xy] \E\pgfplots@update@limits@for@one@point \ifpgfplots@errorbars@enabled % This thing gets the 'current@point@...' context, % that means % \pgfplots@current@point@[xy] % \pgfplots@current@point@[xy]@error % \pgfplots@current@point@[xy]@unfiltered \E\pgfplots@process@errorbar@for% \fi % % Store normalized point for list: % We need % xi,yi,zi,mi; % where zi and mi may be empty. mi is the per-point meta % information. It is used for per-coordinate marker % modifications (like colormaps for scatter plots). \E\edef\E\pgfplots@loc@TMPa{\E\pgfplots@current@point@x,\E\pgfplots@current@point@y,\E\pgfplots@current@point@z,\E\pgfplots@current@point@meta;}% \E\expandafter\E\pgfplotsapplistXXpushback\E\expandafter{\E\pgfplots@loc@TMPa}% % \ifpgfplots@collect@firstplot@astick \ifnum\pgfplots@numplots=0 \E\ifx\E\pgfplots@firstplot@coords@x\E\pgfutil@empty \E\t@pgfplots@tokc={}% \E\else \E\t@pgfplots@tokc=\E\expandafter{\E\pgfplots@firstplot@coords@x,}% \E\fi \E\xdef\E\pgfplots@firstplot@coords@x{\E\the\E\t@pgfplots@tokc\E\pgfplots@current@point@x}% \E\ifx\E\pgfplots@firstplot@coords@y\E\pgfutil@empty \E\t@pgfplots@tokc={}% \E\else \E\t@pgfplots@tokc=\E\expandafter{\E\pgfplots@firstplot@coords@y,}% \E\fi \E\xdef\E\pgfplots@firstplot@coords@y{\E\the\E\t@pgfplots@tokc\E\pgfplots@current@point@y}% % \ifpgfplots@curplot@threedim \E\ifx\E\pgfplots@firstplot@coords@z\E\pgfutil@empty \E\t@pgfplots@tokc={}% \E\else \E\t@pgfplots@tokc=\E\expandafter{\E\pgfplots@firstplot@coords@z,}% \E\fi \E\xdef\E\pgfplots@firstplot@coords@z{\E\the\E\t@pgfplots@tokc\E\pgfplots@current@point@z}% \fi \fi \fi }% % The following code assembles the command which is executed for % each coordinate. % % To eliminate all those case distinctions, it is created with % 'edef' and a lot of '\noexpand' calls here: % % Arguments: % \pgfplots@current@point@[xyz] % \pgfplots@current@point@[xyz]@error (if in argument list) \xdef\pgfplots@process@one@point{% % These things are necessary for error bars: \E\let\E\pgfplots@current@point@x@unfiltered=\E\pgfplots@current@point@x \E\let\E\pgfplots@current@point@y@unfiltered=\E\pgfplots@current@point@y \ifpgfplots@curplot@threedim \E\let\E\pgfplots@current@point@z@unfiltered=\E\pgfplots@current@point@z \fi % \E\pgfplots@prepare@xcoord{\E\pgfplots@current@point@x}% \E\expandafter\E\pgfplots@invoke@filter\E\expandafter{\E\pgfmathresult}{x}% \E\let\E\pgfplots@current@point@x=\E\pgfmathresult % \E\pgfplots@prepare@ycoord{\E\pgfplots@current@point@y}% \E\expandafter\E\pgfplots@invoke@filter\E\expandafter{\E\pgfmathresult}{y}% \E\let\E\pgfplots@current@point@y=\E\pgfmathresult % \ifpgfplots@xislinear \E\ifx\E\pgfplots@current@point@x\E\pgfutil@empty \E\else \E\pgfmathfloatparsenumber{\E\pgfplots@current@point@x}% \E\expandafter\E\pgfmathfloat@decompose@F\E\pgfmathresult\E\relax\E\c@pgf@counta \E\ifnum\E\c@pgf@counta>2 \E\let\E\pgfplots@current@point@x=\E\pgfutil@empty \E\else \E\let\E\pgfplots@current@point@x=\E\pgfmathresult \E\fi \E\fi \fi % \ifpgfplots@yislinear \E\ifx\E\pgfplots@current@point@y\E\pgfutil@empty \E\else \E\pgfmathfloatparsenumber{\E\pgfplots@current@point@y}% \E\expandafter\E\pgfmathfloat@decompose@F\E\pgfmathresult\E\relax\E\c@pgf@counta \E\ifnum\E\c@pgf@counta>2 \E\let\E\pgfplots@current@point@y=\E\pgfutil@empty \E\else \E\let\E\pgfplots@current@point@y=\E\pgfmathresult \E\fi \E\fi \fi % \ifpgfplots@curplot@threedim \E\let\E\pgfplots@current@point@z@unfiltered=\E\pgfplots@current@point@z \E\pgfplots@prepare@zcoord{\E\pgfplots@current@point@z}% \E\expandafter\E\pgfplots@invoke@filter\E\expandafter{\E\pgfmathresult}{z}% \E\let\E\pgfplots@current@point@z=\E\pgfmathresult % \ifpgfplots@zislinear \E\ifx\E\pgfplots@current@point@z\E\pgfutil@empty \E\else \E\pgfmathfloatparsenumber{\E\pgfplots@current@point@z}% \E\expandafter\E\pgfmathfloat@decompose@F\E\pgfmathresult\E\relax\E\c@pgf@counta \E\ifnum\E\c@pgf@counta>2 \E\let\E\pgfplots@current@point@z=\E\pgfutil@empty \E\else \E\let\E\pgfplots@current@point@z=\E\pgfmathresult \E\fi \E\fi \fi \fi % \E\ifx\E\pgfplots@current@point@x\E\pgfutil@empty \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 of the x-coordinate filter.}% \fi \E\else \E\ifx\E\pgfplots@current@point@y\E\pgfutil@empty \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 of the y-coordinate filter.}% \fi \E\else \ifpgfplots@curplot@threedim \E\ifx\E\pgfplots@current@point@z\E\pgfutil@empty \ifpgfplots@warn@for@filter@discards \E\pgfplots@message{NOTE: coordinate (\E\pgfplots@current@point@x@unfiltered,\E\pgfplots@current@point@y@unfiltered,\E\pgfplots@current@point@z@unfiltered) has been dropped because of the z-coordinate filter.}% \fi \E\else % insert the main 3d code here: \pgfplots@loc@TMPa \E\fi \else % insert the main 2d code here: \pgfplots@loc@TMPa \fi \E\fi \E\fi % % increase \pgfplots@current@point@coordindex: \E\begingroup \E\c@pgf@counta=\E\pgfplots@current@point@coordindex \E\advance\E\c@pgf@counta by1\E\relax \E\xdef\E\pgfplots@glob@TMPc{\E\the\E\c@pgf@counta}% \E\endgroup \E\let\E\pgfplots@current@point@coordindex=\E\pgfplots@glob@TMPc }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endgroup %\message{Prepared macro \string\pgfplots@update@limits@for@one@point: {\meaning\pgfplots@update@limits@for@one@point}}% %\message{Prepared macro \string\pgfplots@process@one@point: {\meaning\pgfplots@process@one@point}}% \let\pgfplots@coord@stream@coord@=\pgfplots@process@one@point % \def\pgfplots@coord@stream@end@{% \ifpgfplots@autocompute@all@limits \global\let\pgfplots@data@xmin=\pgfplots@xmin \global\let\pgfplots@data@xmax=\pgfplots@xmax \global\let\pgfplots@data@ymin=\pgfplots@ymin \global\let\pgfplots@data@ymax=\pgfplots@ymax \global\let\pgfplots@data@zmin=\pgfplots@zmin \global\let\pgfplots@data@zmax=\pgfplots@zmax \fi \ifpgfplots@errorbars@enabled \pgfplots@streamerrorbarend \fi \ifpgfplots@stackedmode \pgfplots@stacked@endplot \fi \ifpgfplots@coord@stream@isfirst \pgfplots@warning{the current plot has no coordinates (left?)}% \fi % \else % Idea: use % \scope[plot specification] % % \endscope % \draw plot coordinates {...}; % to share plot specifications between error bars and plot % coordinates. Unfortunately, it is NOT sufficient to use % \tikzset{#1} \ifpgfplots@curplot@isirrelevant \edef\pgfplots@addplot@preoptionsTMP{/pgfplots/every axis plot,/pgfplots/every forget plot/.try}% \else \edef\pgfplots@addplot@preoptionsTMP{/pgfplots/every axis plot,/pgfplots/every axis plot no \the\pgfplots@numplots/.try}% \expandafter\pgfplots@rememberplotspec\expandafter{\pgfplots@addplot@preoptionsTMP,#1,/pgfplots/every axis plot post}% \fi % warning: rememberplotspec calls list macros which % overwrite \t@pgfplots@toka \t@pgfplots@toka=\expandafter{\pgfplots@addplot@preoptionsTMP,#1,/pgfplots/every axis plot post}% \xdef\pgfplots@last@plot@style{\the\t@pgfplots@toka}% store it for \label commands. % ATTENTION: do NOT call list macros from here on! % \ifpgfplots@datascaletrafo@initialised \pgfplots@addplot@get@named@startendpoints@command\pgfplots@loc@TMPa \t@pgfplots@tokc=\expandafter{\pgfplots@loc@TMPa}% \else \t@pgfplots@tokc={}% \fi % assembe a \pgfplots@addplot@enqueue@coords command ... % BEGIN HERE ... % vvvvvvvvvv \xdef\pgfplots@glob@TMPa{% \noexpand\pgfplots@addplot@enqueue@coords {% precommand(s): \expandafter\noexpand\csname pgfplots@curplot@threedim\ifpgfplots@curplot@threedim true\else false\fi\endcsname \noexpand\def\noexpand\plotnum{\the\pgfplots@numplots}% \noexpand\pgfplots@initzerolevelhandler \the\t@pgfplots@tokc% named start/end points (if already available) \noexpand\pgfkeysdef{/tikz/current plot style}{\noexpand\pgfkeysalso{\the\t@pgfplots@toka}}% % per-point meta data ranges: \noexpand\xdef\noexpand\pgfplots@metamin{\pgfplots@metamin}% \noexpand\xdef\noexpand\pgfplots@metamax{\pgfplots@metamax}% \ifpgfplots@perpointmeta@usesfloat \noexpand\pgfplots@perpointmeta@usesfloattrue \else \noexpand\pgfplots@perpointmeta@usesfloatfalse \fi \noexpand\def\noexpand\pgfplots@perpointmeta@choice{\pgfplots@perpointmeta@choice}% }% {% draw command: \noexpand\draw% }% }% \pgfplotsapplistXXlet\pgfplots@coord@stream@recorded \pgfplotsapplistXXclear \t@pgfplots@tokc=\expandafter{\pgfplots@coord@stream@recorded}% \t@pgfplots@tokb={#2;}% \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPa}% \xdef\pgfplots@glob@TMPa{% \the\t@pgfplots@toka {% coordinates which need to be processed in \endaxis. % See % \pgfplots@coord@stream@finalize@storedcoords@START normalized coordinates {\the\t@pgfplots@tokc}\the\t@pgfplots@tokb }% }% % % Ok, now assemble the POST COMMANDS. Error bar % commands will be append here (if any) \ifx\pgfplots@recordederrorbar\pgfutil@empty \pgfplots@glob@TMPa {% % Post commands are empty here. }% \else \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPa}% \t@pgfplots@tokb=\expandafter{\pgfplots@recordederrorbar}% \def\pgfplots@loc@TMPb{% \noexpand\pgfplots@errorbars@finishwithstyleoptions[current plot style]{\the\t@pgfplots@tokb}% }% \xdef\pgfplots@glob@TMPa{ \the\t@pgfplots@toka { % Post commands: append error bar commands. \pgfplots@loc@TMPb }% }% \pgfplots@glob@TMPa \fi %^^^^^^^^^^^^ ... END of \pgfplots@addplot@enqueue@coords HERE % \fi \pgfplots@end@plot }% }% % Defines the linear transformation macro \pgfplots@perpointmeta@trafo, % % phi : [meta_min,meta,max] -> [0,10^k] % % which operates on the per-point meta data (if any). % The trafo will be skipped if there is no such data. % % The trafo is expected to prepare meta information before it is used % as input to \pgfplotscolormapfind. Thus, the 10^k is chosen to be % the same as \pgfplotscolormaprange (which is 1000 per default). % % If there is now data range (for example because meta information is % not available or is not of numeric type), the trafo will simply % copy the input argument symbolically. \def\pgfplots@perpointmeta@preparetrafo{% \ifx\pgfplots@metamax\pgfutil@empty \def\pgfplots@perpointmeta@trafo##1{\def\pgfmathresult{##1}}% \def\pgfplots@perpointmeta@traforange{0:0}% \else % The transformation is % % phi(m) = ( m- meta_min) * 1000/ (meta_max-meta_min). % % -> precompute the scaling factor! \ifpgfplots@perpointmeta@usesfloat \edef\pgfplots@loc@TMPa{\pgfplotscolormaprange}% \ifnum\pgfplots@loc@TMPa=1000 \else \pgfplots@error{LOGIC ERROR: sorry, I have hard-coded the assumption \string\pgfplotscolormaprange = 1000, but now it is \pgfplots@loc@TMPa.}% \fi \pgfmathfloatsubtract@{\pgfplots@metamax}{\pgfplots@metamin}% \let\pgfplots@loc@TMPa=\pgfmathresult \pgfmathfloatcreate{1}{1.0}{3}% \expandafter\pgfmathfloatdivide@\expandafter{\pgfmathresult}{\pgfplots@loc@TMPa}% \let\pgfplots@perpointmeta@trafo@factor=\pgfmathresult % % Now, setup the trafo as such. % It assigns \pgfmathresult (in fixed point). \def\pgfplots@perpointmeta@trafo##1{% \pgfmathfloatsubtract@{##1}{\pgfplots@metamin}% \expandafter\pgfmathfloatmultiply@\expandafter{\pgfmathresult}{\pgfplots@perpointmeta@trafo@factor}% \expandafter\pgfmathfloattofixed@\expandafter{\pgfmathresult}% }% % Expands to the transformation range as 'a:b': \def\pgfplots@perpointmeta@traforange{0:1000}% \else \edef\pgfplots@loc@TMPa{\pgfplotscolormaprange}% \ifnum\pgfplots@loc@TMPa=1000 \else \pgfplots@error{LOGIC ERROR: sorry, I have hard-coded the assumption \string\pgfplotscolormaprange = 1000, but now it is \pgfplots@loc@TMPa.}% \fi \pgfmathsubtract@{\pgfplots@metamax}{\pgfplots@metamin}% \let\pgfplots@loc@TMPa=\pgfmathresult \expandafter\pgfmathdivide@\expandafter{\pgfplotscolormaprange}{\pgfplots@loc@TMPa}% \let\pgfplots@perpointmeta@trafo@factor=\pgfmathresult % % Now, setup the trafo as such. % It assigns \pgfmathresult (in fixed point). \def\pgfplots@perpointmeta@trafo##1{% \pgfmathsubtract@{##1}{\pgfplots@metamin}% \expandafter\pgfmathmultiply@\expandafter{\pgfmathresult}{\pgfplots@perpointmeta@trafo@factor}% }% % Expands to the transformation range as 'a:b': \def\pgfplots@perpointmeta@traforange{0:1000}% \fi \fi }% % A looping method which applies % \pgfplots@coord@stream@start % for each coordinate '(x,y)' or '(x,y) +- (ex,ey)', % assign \pgfplots@current@point@[xyz] % assign \pgfplots@current@point@[xyz]@error (if in argument list) % assign \pgfplots@current@point@meta % call \pgfplots@coord@stream@coord % \pgfplots@coord@stream@end % % #1 a sequence of coordinates of the form % '(x,y)' or '(x,y,z)' % or % '(x,y[,z]) +- (ex,ey)' % or % '(x,y) [meta]' % or % '(x,y) +- (ex,ey) [meta]' % separated by white-space. % % The per-point meta is not implemented yet. \long\def\pgfplots@coord@stream@foreach#1{% \pgfplots@coord@stream@start \pgfplots@foreach@plot@coord@ITERATE#1\pgfplots@EOI% \pgfplots@coord@stream@end }% % A looping command to loop through plot coordinates. % For every point, #1{X}{Y} will be invoked. % % No scoping is used during this operation, so you can access outer % variables. \def\pgfplots@foreach@plot@coord@ITERATE{% \pgfutil@ifnextchar\pgfplots@EOI{% \pgfplots@foreach@plot@coord@FINISH% }{% \pgfutil@ifnextchar\par{% \pgfplots@foreach@plot@coord@ITERATE@gobbleone }{% \pgfutil@ifnextchar({% \pgfplots@foreach@plot@coord@NEXT% }{% \pgfplots@foreach@plot@coord@error }% }% }% } \long\def\pgfplots@foreach@plot@coord@error#1\pgfplots@EOI{% \pgfplots@error{Sorry, I could not read the plot coordinates near '#1'. Please check for format mistakes.}% }% \long\def\pgfplots@foreach@plot@coord@ITERATE@gobbleone#1{\pgfplots@foreach@plot@coord@ITERATE}% \def\pgfplots@foreach@plot@coord@NEXT(#1,#2){% \def\pgfplots@current@point@x{#1}% \def\pgfplots@current@point@y{#2}% \pgfutil@ifnextchar+{% \pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE% }{% \let\pgfplots@current@point@x@error=\pgfutil@empty \let\pgfplots@current@point@y@error=\pgfutil@empty \pgfutil@ifnextchar[{% \pgfplots@foreach@plot@coord@NEXT@meta }{% \let\pgfplots@current@point@meta=\pgfutil@empty \pgfplots@coord@stream@coord \pgfplots@foreach@plot@coord@ITERATE }% }% } \def\pgfplots@foreach@plot@coord@NEXT@meta[#1]{% \def\pgfplots@current@point@meta{#1}% \pgfplots@coord@stream@coord \pgfplots@foreach@plot@coord@ITERATE }% % processing something like '(x,y) +- (error_x,error_y)' \def\pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE+-#1({% \pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE@% } \def\pgfplots@foreach@plot@coord@NEXT@WITH@ERRORRANGE@#1,#2){% \def\pgfplots@current@point@x@error{#1}% \def\pgfplots@current@point@y@error{#2}% \pgfutil@ifnextchar[{% \pgfplots@foreach@plot@coord@NEXT@meta }{% \let\pgfplots@current@point@meta=\pgfutil@empty \pgfplots@coord@stream@coord \pgfplots@foreach@plot@coord@ITERATE }% } \def\pgfplots@foreach@plot@coord@FINISH\pgfplots@EOI{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 % The same for three dim coords: \long\def\pgfplots@coord@stream@foreach@threedim#1{% \pgfplots@coord@stream@start \pgfplots@foreach@plot@coord@threedim@ITERATE#1\pgfplots@EOI% \pgfplots@coord@stream@end }% \def\pgfplots@foreach@plot@coord@threedim@ITERATE{% \pgfutil@ifnextchar\pgfplots@EOI{% \pgfplots@foreach@plot@coord@FINISH% }{% \pgfutil@ifnextchar\par{% \pgfplots@foreach@plot@coord@threedim@ITERATE@gobbleone }{% \pgfutil@ifnextchar({% \pgfplots@foreach@plot@coord@threedim@NEXT% }{% \pgfplots@foreach@plot@coord@error }% }% }% } \long\def\pgfplots@foreach@plot@coord@threedim@ITERATE@gobbleone#1{\pgfplots@foreach@plot@coord@threedim@ITERATE}% \def\pgfplots@foreach@plot@coord@threedim@NEXT(#1,#2,#3){% \def\pgfplots@current@point@x{#1}% \def\pgfplots@current@point@y{#2}% \def\pgfplots@current@point@z{#3}% \pgfutil@ifnextchar+{% \pgfplots@foreach@plot@coord@threedim@NEXT@WITH@ERRORRANGE% }{% \let\pgfplots@current@point@x@error=\pgfutil@empty \let\pgfplots@current@point@y@error=\pgfutil@empty \let\pgfplots@current@point@z@error=\pgfutil@empty \pgfutil@ifnextchar[{% \pgfplots@foreach@plot@coord@threedim@NEXT@meta }{% \let\pgfplots@current@point@meta=\pgfutil@empty \pgfplots@coord@stream@coord \pgfplots@foreach@plot@coord@threedim@ITERATE }% }% } \def\pgfplots@foreach@plot@coord@threedim@NEXT@meta[#1]{% \def\pgfplots@current@point@meta{#1}% \pgfplots@coord@stream@coord \pgfplots@foreach@plot@coord@threedim@ITERATE }% % processing something like '(x,y) +- (error_x,error_y)' \def\pgfplots@foreach@plot@coord@threedim@NEXT@WITH@ERRORRANGE+-#1({% \pgfplots@foreach@plot@coord@threedim@NEXT@WITH@ERRORRANGE@% } \def\pgfplots@foreach@plot@coord@threedim@NEXT@WITH@ERRORRANGE@#1,#2,#3){% \def\pgfplots@current@point@x@error{#1}% \def\pgfplots@current@point@y@error{#2}% \def\pgfplots@current@point@z@error{#3}% \pgfutil@ifnextchar[{% \pgfplots@foreach@plot@coord@threedim@NEXT@meta }{% \let\pgfplots@current@point@meta=\pgfutil@empty \pgfplots@coord@stream@coord \pgfplots@foreach@plot@coord@threedim@ITERATE }% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 % % The same in normalized coordinates of the form % x1,y1,z1,m1;x2,y2,z2,m2;...;xN,yN,zN,mN; % if the plot is not threedim, zi is empty. % % The mi are Meta Values associated to point coordinates. They are % usually empty, but can be used to realize per-point marker % modifications (scatter plots, especially for colormaps). \long\def\pgfplots@coord@stream@foreach@NORMALIZED#1{% \pgfplots@coord@stream@start \pgfplots@foreach@plot@coord@NORMALIZED@ITERATE#1\pgfplots@EOI \pgfplots@coord@stream@end }% % A looping command to loop through plot coordinates. % For every point, #1{X}{Y} will be invoked. % % No scoping is used during this operation, so you can access outer % variables. \def\pgfplots@foreach@plot@coord@NORMALIZED@ITERATE{% \pgfutil@ifnextchar\pgfplots@EOI{% \pgfplots@foreach@plot@coord@FINISH% }{% \pgfplots@foreach@plot@coord@NORMALIZED@NEXT% }% } \def\pgfplots@foreach@plot@coord@NORMALIZED@NEXT#1,#2,#3,#4;{% \def\pgfplots@current@point@x{#1}% \def\pgfplots@current@point@y{#2}% \def\pgfplots@current@point@z{#3}% \def\pgfplots@current@point@meta{#4}% \pgfplots@coord@stream@coord \pgfplots@foreach@plot@coord@NORMALIZED@ITERATE } \newif\ifpgfplots@curplot@threedim % The main interface to draw a plot into an axis. % % Usage: % \addplot % plot coordinates { % (0,0) % (1,1) % }; % % or % % \addplot[color=blue,mark=*] % plot coordinates { % (0,0) % (1,1) % }; % % 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. % % \addplot [