summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-03-27 23:45:11 +0000
committerKarl Berry <karl@freefriends.org>2013-03-27 23:45:11 +0000
commitcfb1e943eb2782734fb13768cf8242e6a03aa904 (patch)
tree59470eac1319852a3b8726e3308923e0e1019bb5 /Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
parent02aa64ea1b6cd28f8217d06507a941c70d39dd9a (diff)
pgfplots
git-svn-id: svn://tug.org/texlive/trunk@29531 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex412
1 files changed, 281 insertions, 131 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
index a6fa1eae255..81a81d41c66 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
@@ -112,6 +112,9 @@
\tikzdeclarecoordinatesystem{xticklabel}{\pgfplotspointticklabelcs{x}{##1}}%
\tikzdeclarecoordinatesystem{yticklabel}{\pgfplotspointticklabelcs{y}{##1}}%
\tikzdeclarecoordinatesystem{zticklabel}{\pgfplotspointticklabelcs{z}{##1}}%
+ \tikzdeclarecoordinatesystem{xticklabel*}{\pgfplotspointticklabelnoshiftcs{x}{##1}}%
+ \tikzdeclarecoordinatesystem{yticklabel*}{\pgfplotspointticklabelnoshiftcs{y}{##1}}%
+ \tikzdeclarecoordinatesystem{zticklabel*}{\pgfplotspointticklabelnoshiftcs{z}{##1}}%
%
% does also declare the 'near xticklabel*' variants.
\pgfplotsdeclareborderanchorforticklabelaxis{x}{near xticklabel}%
@@ -355,6 +358,23 @@
\expandafter\pgfplots@loc@TMPb\pgfplots@loc@TMPa\relax
}%
+\def\pgfplotspointticklabelnoshiftcs#1#2{%
+ \pgfutil@in@{,}{#2}%
+ \ifpgfutil@in@
+ \edef\pgfplots@loc@TMPa{#2}%
+ \else
+ \edef\pgfplots@loc@TMPa{#2,0}%
+ \fi
+ \def\pgfplots@loc@TMPb##1,##2\relax{%
+ % invoke
+ % \pgfplotsqpointoutsideofticklabelaxisrel{#2}{##1}{##2}:
+ \pgfmathparse{##2}%
+ \def\pgfplots@loc@TMPa{\pgfplotsqpointoutsideofticklabelaxisrel{#1}{##1}}%
+ \expandafter\pgfplots@loc@TMPa\expandafter{\pgfmathresult}%
+ }%
+ \expandafter\pgfplots@loc@TMPb\pgfplots@loc@TMPa\relax
+}%
+
% Converts a dimen (with unit!) to a corresponding x, y or z
% coordinate.
@@ -944,8 +964,9 @@
% 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)
+% '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.
%
% If the 'oriented surface char' is 'v', then we actually don't have
@@ -954,6 +975,9 @@
% designated orientations.
%
% @POST \pgfplots@loc@TMPa contains the return value macro.
+% More precisely, \pgfplots@loc@TMPa will be EMPTY is #1#2#3 is NOT
+% on #4#5#6 . It will contain the value on the surface if it IS on
+% the surface
\def\pgfplotspointonorientedsurfaceabmatchaxisline@#1#2#3:#4#5#6\pgfplots@EOI{%
% Search for the 'b' character:
\if#4b%
@@ -974,6 +998,7 @@
\pgfplotspointonorientedsurfaceabmatchaxisline@single{#1}{#4}%
\pgfplotspointonorientedsurfaceabmatchaxisline@single{#2}{#5}%
\pgfplotspointonorientedsurfaceabmatchaxisline@single{#3}{#6}%
+%\message{\string\pgfplotspointonorientedsurfaceabmatchaxisline@#1#2#3:#4#5#6 = '\pgfplots@loc@TMPa'.^^J}%
}
\def\pgfplotspointonorientedsurfaceabmatchaxisline@single#1#2{%
\if#1v%
@@ -998,10 +1023,19 @@
\let\pgfplots@loc@TMPa=\pgfutil@empty
\fi
\else
- % return TRUE.
- % I admit I am not sure at all if this works in all
- % cases
- \pgfplotspointonorientedsurfaceabmatchaxisline@warn{#1}%
+ \if2#1%
+ \if0#2%
+ \let\pgfplots@loc@TMPa=\pgfutil@empty
+ \fi
+ \if1#2%
+ \let\pgfplots@loc@TMPa=\pgfutil@empty
+ \fi
+ \else
+ % return TRUE.
+ % I admit I am not sure at all if this works in all
+ % cases
+ \pgfplotspointonorientedsurfaceabmatchaxisline@warn{#1}%
+ \fi
\fi
\fi
\fi
@@ -1176,8 +1210,6 @@
% Overwrite in subclasses if necessary.
\def\pgfplotspointouternormalvectorofaxis@ifdependson@v#1#2#3{#3}
-% FIXME : this doesn't work if one of the three characters is '2' (for
-% center)
\def\pgfplotspointouternormalvectorofaxis@#1#2#3\relax{%
\if v#1%
\def\pgfplots@loc@point@orthogonal@to@v##1##2{%
@@ -1185,6 +1217,7 @@
}%
\def\pgfplots@loc@char@for@baxis{#2}%
\def\pgfplots@loc@char@for@naxis{#3}%
+ \def\pgfplots@loc@vaxis{x}%
\def\pgfplots@loc@baxis{y}%
\def\pgfplots@loc@naxis{z}%
\else
@@ -1194,6 +1227,7 @@
}%
\def\pgfplots@loc@char@for@baxis{#1}%
\def\pgfplots@loc@char@for@naxis{#3}%
+ \def\pgfplots@loc@vaxis{y}%
\def\pgfplots@loc@baxis{x}%
\def\pgfplots@loc@naxis{z}%
\else
@@ -1202,52 +1236,26 @@
}%
\def\pgfplots@loc@char@for@baxis{#1}%
\def\pgfplots@loc@char@for@naxis{#2}%
+ \def\pgfplots@loc@vaxis{z}%
\def\pgfplots@loc@baxis{x}%
\def\pgfplots@loc@naxis{y}%
\fi
\fi
- \ifcase\pgfplots@loc@char@for@baxis\relax%
- % case 0:
- % this means : the '##1' direction of the surface
- % orthogonal to the 'v' vector is on the lower axis
- % limit. Since I need a vector pointing to the OUTSIDE of
- % the axis, I need sign = -1
- \def\pgfplots@loc@baxissign{-}%
- \or
- % case 1:
- % in this case, the OUTSIDE area requires a plus sign - the b
- % axis already points to the inside.
- \def\pgfplots@loc@baxissign{+}%
- \or
- % case 2: we have the 'axis lines=centered' case.
- % FIXME :
- \def\pgfplots@loc@baxissign{+}%
- \fi
+ %
+ \pgfplotspointouternormalvectorofaxis@get@otheraxis@sign{\pgfplots@loc@vaxis}{\pgfplots@loc@baxis}{\pgfplots@loc@char@for@baxis}%
+ \let\pgfplots@loc@baxissign=\pgfplotsretval
+ %
+ \pgfplotspointouternormalvectorofaxis@get@otheraxis@sign{\pgfplots@loc@vaxis}{\pgfplots@loc@naxis}{\pgfplots@loc@char@for@naxis}%
+ \let\pgfplots@loc@naxissign=\pgfplotsretval
+ %
+ %
+ % ok, compute vector scales:
\pgfplotsmath@ifzero{\csname pgfplots@\pgfplots@loc@baxis @veclength\endcsname}{%
\def\pgfplots@loc@baxissign{0}%
\def\pgfplots@loc@baxisscale{0}%
}{%
\edef\pgfplots@loc@baxisscale{\pgfplots@loc@baxissign\csname pgfplots@\pgfplots@loc@baxis @inverseveclength\endcsname}%
}%
- %
- % Now the same game for the other axis:
- \ifcase\pgfplots@loc@char@for@naxis\relax
- % case 0:
- % this means : the '##2' direction of the surface
- % orthogonal to the 'v' vector is on the lower axis
- % limit. Since I need a vector pointing to the OUTSIDE of
- % the axis, I need sign = -1
- \def\pgfplots@loc@naxissign{-}%
- \or
- % case 1:
- % in this case, the OUTSIDE area requires a plus sign - the n
- % axis already points to the inside.
- \def\pgfplots@loc@naxissign{+}%
- \or
- % case 2: centered.
- % FIXME
- \def\pgfplots@loc@naxissign{+}%
- \fi
\pgfplotsmath@ifzero{\csname pgfplots@\pgfplots@loc@naxis @veclength\endcsname}{%
\def\pgfplots@loc@naxissign{0}%
\def\pgfplots@loc@naxisscale{0}%
@@ -1263,6 +1271,58 @@
\endgroup
}%
+% #1: the axis for which we want the "outer normal".
+% #2: the "other axis" for which we seek the sign.
+% #3: the entry in the three-char-identifier which corresponds to
+% "other axis".
+\def\pgfplotspointouternormalvectorofaxis@get@otheraxis@sign#1#2#3{%
+ \ifcase#3\relax%
+ % case 0:
+ % this means : the '##1' direction of the surface
+ % orthogonal to the 'v' vector is on the lower axis
+ % limit. Since I need a vector pointing to the OUTSIDE of
+ % the axis, I need sign = -1
+ \def\pgfplotsretval{-}%
+ \or
+ % case 1:
+ % in this case, the OUTSIDE area requires a plus sign - the b
+ % axis already points to the inside.
+ \def\pgfplotsretval{+}%
+ \or
+ % case 2: we have the 'axis lines=centered' case.
+ %
+ % This case is complicated. The problem is that we do not know
+ % if we are at the top or bottom limit.
+ %
+ % BUT: we know what we would have done if this would be a
+ % normal boxed axis!
+ %
+ % 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.
+ %
+ % We computed it at startup. Might be a hack ... :-(
+ \edef\pgfplots@loc@TMPb{\csname pgfplots@#1ticklabelaxisspec@box\endcsname}%
+ %
+ % decode it: we have to replace '#3' by the value that it has
+ % in that boxed ticklabel axis spec!
+ \def\pgfplots@loc@TMPa##1##2##3{%
+ % search for the correct entry.
+ \if x#2\def\pgfplotsretval{##1}\fi
+ \if y#2\def\pgfplotsretval{##2}\fi
+ \if z#2\def\pgfplotsretval{##3}\fi
+ }%
+ \expandafter\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ %
+ \if 2\pgfplotsretval
+ \pgfplots@error{internal assertion failed.}%
+ \fi
+ %
+ % invoke it again!
+ \pgfplotspointouternormalvectorofaxis@get@otheraxis@sign{#1}{#2}{\pgfplotsretval}%
+ \fi
+}
+
% very-low-level internal routine. Never invoke it directly.
% @PRECONDITION:
% an \begingroup has been opened.
@@ -1498,7 +1558,8 @@
\def\pgfplotsdeclareborderanchorforaxis#1#2#3{%
%
%
- \pgfdeclaregenericanchor{#3}{\pgfplots@borderanchor@for@axis{#1}{#2}{##1}}
+ \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....
@@ -1548,6 +1609,14 @@
% #3: the shape, provided as argument by the pgf routine invoking the
% anchor.
\def\pgfplots@borderanchor@for@axis#1#2#3{%
+ \pgfplots@borderanchor@for@axis@{#1}{#2}{#3}{-1}%
+}
+% same as \pgfplots@borderanchor@for@axis{#1}{#2}{3} except that #4 is
+% the SIGN for the outer normal.
+%
+% #4: the sign for the outer normal. #4=-1 means "use inner normal"
+% and +1 means "use outer normal"
+\def\pgfplots@borderanchor@for@axis@#1#2#3#4{%
\begingroup
\pgfutil@ifundefined{pgfreferencednodename}{%
% use given transformation matrix.
@@ -1561,8 +1630,8 @@
}%
% I only need to apply the trafo matrix to direction vectors. Eliminate
% shifts.
- \pgf@pt@x=0pt
- \pgf@pt@y=0pt
+ \pgf@pt@x=0pt %
+ \pgf@pt@y=0pt %
%
% I'll apply the inverse transformation matrix to direction
% vectors. To ensure the relative position of these vectors
@@ -1571,68 +1640,20 @@
%
%
% This here is the normal direction (points to the axis)
- \pgfqpointscale{-1}{\pgfplotspointouternormalvectorofaxis{#2}}%
+ \pgfqpointscale{#4}{\pgfplotspointouternormalvectorofaxis{#2}}%
%
% 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}%
%
- % 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). If we choose
- % this anchor, we *won't* penetrate the axis!
- %
- % This is a heuristicial procedure.
- %
- \def\pgfplots@thresh{0.17pt }% 80 degrees
- %\def\pgfplots@thresh{0.3pt }%
- %\def\pgfplots@thresh{0.707pt }% 45 degrees
- \ifdim\pgf@y>0pt
- \ifdim\pgf@y>\pgfplots@thresh
- % only north anchor
- \def\pgfplots@ycomp{north}%
- \else
- \def\pgfplots@ycomp{}%
- \fi
- \else
- \ifdim\pgf@y<-\pgfplots@thresh
- \def\pgfplots@ycomp{south}%
- % south anchor
- \else
- \def\pgfplots@ycomp{}%
- \fi
- \fi
- \ifdim\pgf@x>0pt
- \ifdim\pgf@x>\pgfplots@thresh
- \def\pgfplots@xcomp{east}%
- \else
- \def\pgfplots@xcomp{}%
- \fi
- \else
- \ifdim\pgf@x<-\pgfplots@thresh
- \def\pgfplots@xcomp{west}%
- \else
- \def\pgfplots@xcomp{}%
- \fi
- \fi
- \edef\pgfplots@anchor{%
- \pgfplots@ycomp
- \ifx\pgfplots@ycomp\pgfutil@empty
- \else
- \ifx\pgfplots@xcomp\pgfutil@empty
- \else
- \space
- \fi
- \fi
- \pgfplots@xcomp}%
- %
+ \pgfplots@borderanchor@snap@to@nearest@anchor{}% takes \pgf@x and \pgf@y
+ \let\pgfplots@anchor=\pgfplotsretval
%
% Now, I'd like the 'center' of the node on one line with the
% 'at={}' coordinate at which it shall be placed!
% This can be done as follows:
%
- % Now, compute two lines:
+ % Compute two lines:
% 1. a line parallel to the #1 axis which goes
% through our recently identified anchor,
% { x = x_a + r_1 * (#1 axis direction)
@@ -1642,21 +1663,60 @@
% Calculate the intersection point and return it! This
% involves a lot of arithmetics :-(
%
+ % UPDATE: I realized that using the 'center' anchor might be too
+ % restrictive. See the 'near ticklabel align' key.
+ %
+ % Note that this is actually too much work for the 2d case - I
+ % guess it would be more efficient without it. But for 3d, it
+ % really rocks.
+ %
% compute (unit#1 - normal):
\pgfplots@tmp@normaldir
\pgf@xb=\pgf@x
\pgf@yb=\pgf@y
%
% and the axis direction (in fact, I use -axis dir. But that
- % doesn't matter).
+ % doesn't matter for the intersection of two lines).
% Scale unit vector to length 1 to improve conditioning:
\pgfqpointscale
{\csname pgfplotsunit#1invlength\endcsname}
{\csname pgfplotspointunit#1\endcsname}%
- \pgf@xa=\pgf@x
+ % FIXME : shouldn't the values be copied AFTER the CM!?
+ \pgf@xa=\pgf@x
\pgf@ya=\pgf@y
\pgf@pos@transform\pgf@xa\pgf@ya
%
+ \ifcase\pgfplots@borderanchor@align\relax
+ % near ticklabel align=inside:
+ % make sure that we are close to the beginning of the axis
+ % direction vector.
+ \pgfplots@borderanchor@snap@to@nearest@anchor{%
+ \if\pgfkeysvalueof{/pgfplots/#1 dir/value}n%
+ % simply take \pgf@x and \pgf@y as-is.
+ \else
+ \global\pgf@x=-\pgf@x
+ \global\pgf@y=-\pgf@y
+ \fi
+ }%
+ \or
+ % near ticklabel align=center:
+ \def\pgfplotsretval{center}% Ah. simple.
+ \or
+ % near ticklabel align=outside:
+ % make sure that we are far away from the beginning of the
+ % axis direction vector.
+ \pgfplots@borderanchor@snap@to@nearest@anchor{%
+ \if\pgfkeysvalueof{/pgfplots/#1 dir/value}n%
+ \global\pgf@x=-\pgf@x
+ \global\pgf@y=-\pgf@y
+ \else
+ % simply take \pgf@x and \pgf@y as-is.
+ \fi
+ }%
+ \fi
+ \let\pgfplots@anchor@inner=\pgfplotsretval
+ %
+ %
% 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
@@ -1672,7 +1732,9 @@
{\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@ya}%
}%
%
- \pgf@sh@reanchor{#3}{center}%
+ % 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}%
\edef\pgfplots@loc@center{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
%
% apply inverse matrix to right-hand-side (and compute RHS):
@@ -1693,7 +1755,7 @@
{\pgfplots@loc@center}%
{\pgfqpointscale{\pgfplots@r}{\pgfplots@tmp@normaldir}}%
\else
- \message{^^JPGFPlots warning: The ticklabel anchor cannot be determined, the normal vector -(\the\pgf@xb,\the\pgf@yb) and the unit #1 vector (\the\pgf@xa,\the\pgf@ya) are almost parallel (abs(cos(angle)) = \the\pgf@xc)!^^J}%
+ \pgfplotswarning{ticklabel anchor undetermined}{#1}{\the\pgf@xb,\the\pgf@yb}{\the\pgf@xa,\the\pgf@ya}{\the\pgf@xc}\pgfeov
% Something went awry: normal and unit#1 are almost parallel!?
% just use the determined anchor.
\def\pgfplots@r{0}%
@@ -1704,6 +1766,72 @@
\endgroup
}%
+% #1: a direction vector.
+%
+% assigns the resulting anchor to \pgfplotsretval
+\def\pgfplots@borderanchor@snap@to@nearest@anchor#1{%
+ \begingroup
+ #1%
+ % 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).
+ %
+ % 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
+ % point; we will refine it in the next step.
+ %
+ % This is a heuristicial procedure.
+ %
+ % Note that it does not hurt if there are "multiple best matches"
+ % (for example because they lie on the same line).
+ % The code below will move the final anchor point.
+ %
+ \def\pgfplots@thresh{0.17pt }% 80 degrees
+ %\def\pgfplots@thresh{0.3pt }%
+ %\def\pgfplots@thresh{0.707pt }% 45 degrees
+ \ifdim\pgf@y>0pt
+ \ifdim\pgf@y>\pgfplots@thresh
+ % only north anchor
+ \def\pgfplots@ycomp{north}%
+ \else
+ \def\pgfplots@ycomp{}%
+ \fi
+ \else
+ \ifdim\pgf@y<-\pgfplots@thresh
+ \def\pgfplots@ycomp{south}%
+ % south anchor
+ \else
+ \def\pgfplots@ycomp{}%
+ \fi
+ \fi
+ \ifdim\pgf@x>0pt
+ \ifdim\pgf@x>\pgfplots@thresh
+ \def\pgfplots@xcomp{east}%
+ \else
+ \def\pgfplots@xcomp{}%
+ \fi
+ \else
+ \ifdim\pgf@x<-\pgfplots@thresh
+ \def\pgfplots@xcomp{west}%
+ \else
+ \def\pgfplots@xcomp{}%
+ \fi
+ \fi
+ \edef\pgfplotsretval{%
+ \pgfplots@ycomp
+ \ifx\pgfplots@ycomp\pgfutil@empty
+ \else
+ \ifx\pgfplots@xcomp\pgfutil@empty
+ \else
+ \space
+ \fi
+ \fi
+ \pgfplots@xcomp
+ }%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}
\def\pgfplotspointviewdir{%
%\pgfplotsmathvectordatascaletrafoinverse{\pgfplots@view@dir@threedim}{default}%
@@ -1773,6 +1901,7 @@
parsenumber=\pgfmathfloatparsenumber{##1}\pgfmathfloattofixed{##1},%
zero= \pgfplotscoordmath{\pgfplotscoordmathid}{parsenumber}{0},
one= \pgfplotscoordmath{\pgfplotscoordmathid}{parsenumber}{1},
+ -one= \pgfplotscoordmath{\pgfplotscoordmathid}{parsenumber}{-1},
log e= \pgfmathlog@{##1},%
log to display log=\pgfmath@basic@multiply@{##1}{2.3025851},% * log(10)
log from display log=\pgfmath@basic@multiply@{##1}{0.434294},% / log(10)
@@ -1822,7 +1951,7 @@
if is bounded=\edef\pgfplotsretval{##1}\ifx\pgfplotsretval\pgfutil@empty ##3\else ##2\fi,
suffix= #1,%
datascaletrafo set params=,
- datascaletrafo get params= \def\pgfmathresult{{0}{0}},
+ datascaletrafo get params= \def\pgfmathresult{{0}{0}}\def\pgfplotsretval{0}\def\pgfplotsretvalb{0},
datascaletrafo= \edef\pgfmathresult{##1},
datascaletrafo inverse= \edef\pgfmathresult{##1},
datascaletrafo noshift inverse= \edef\pgfmathresult{##1},
@@ -1885,6 +2014,8 @@
{\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ zero\endcsname{#1}},%
one/.code=
{\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ one\endcsname{#1}},%
+ -one/.code=
+ {\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ -one\endcsname{#1}},%
%
% Calls pgfmathparse. Note that this might need to switch to the
% required math library (which is not necessarily cheap)
@@ -1993,8 +2124,10 @@
% {#1}{#2} required for 'datascaletrafo set params':
% #1: the EXPONENT (as integer)
% #2: the SHIFT (as fixed point number)
- datascaletrafo get params/.code=
- {\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ datascaletrafo get params\endcsname{#1}},%
+ % AND \pgfplotsretval as the EXPONENT and \pgfplotsretvalb as the SHIFT
+ datascaletrafo get params/.code={%
+ \expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ datascaletrafo get params\endcsname{#1}%
+ },%
datascaletrafo/.code=
{\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ datascaletrafo\endcsname##1{#1}},%
datascaletrafo inverse/.code=
@@ -2185,6 +2318,7 @@
suffix=@basic@,
zero=\def\pgfmathresult{0},
one=\def\pgfmathresult{1},
+ -one=\def\pgfmathresult{-1},
}
\pgfplotsdeclarecoordmath{float}{%
initialise=
@@ -2196,6 +2330,7 @@
parse=\begingroup \pgfkeys{/pgf/fpu}\pgfmathparse{#1}\pgfmath@smuggleone\pgfmathresult\endgroup,
zero=\pgfmathfloatcreate{0}{0.0}{0},%
one=\pgfmathfloatcreate{1}{1.0}{0},%
+ -one=\pgfmathfloatcreate{2}{1.0}{0},%
tofixed=\pgfmathfloattofixed{#1},
tostring=\pgfmathfloattosci{#1},
max=\pgfplotsmathfloatmax{#1}{#2},%
@@ -2218,9 +2353,11 @@
\expandafter\edef\csname pgfplots@data@scale@trafo@SHIFT@\pgfplotscoordmathid\endcsname{#1}%
},%
datascaletrafo get params={%
+ \edef\pgfplotsretval{\csname pgfplots@data@scale@trafo@EXPONENT@\pgfplotscoordmathid\endcsname}%
+ \edef\pgfplotsretvalb{\csname pgfplots@data@scale@trafo@SHIFT@\pgfplotscoordmathid\endcsname}%
\edef\pgfmathresult{%
- {\csname pgfplots@data@scale@trafo@EXPONENT@\pgfplotscoordmathid\endcsname}%
- {\csname pgfplots@data@scale@trafo@SHIFT@\pgfplotscoordmathid\endcsname}%
+ {\pgfplotsretval}%
+ {\pgfplotsretvalb}%
}%
},%
datascaletrafo={%
@@ -2975,7 +3112,7 @@
%
% Prepare \pgfplots@current@point@meta (see the preparation
% routine above):
- \E\pgfplots@set@perpointmeta
+ \E\pgfplotsaxissurveysetpointmeta
%
\ifpgfplots@errorbars@enabled
% This thing gets the 'current@point@...' context,
@@ -3035,6 +3172,7 @@
\E\else
it is unbounded (in \E\pgfplots@unbounded@dir).
\E\fi
+ (see also unbounded coords=jump).
}%
\fi
\else
@@ -3062,7 +3200,11 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endgroup
%
- \def\pgfplotsaxissurveysetpointmeta{\pgfplots@set@perpointmeta}%
+ \def\pgfplotsaxissurveysetpointmeta{%
+ \pgfplotsplothandlersurveybeforesetpointmeta
+ \pgfplots@set@perpointmeta
+ \pgfplotsplothandlersurveyaftersetpointmeta
+ }%
%
%\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}}%
@@ -3087,6 +3229,7 @@
% optimized 'applistXX' structure:
\pgfplotsapplistXXnewempty
%
+ \edef\plotnumofactualtype{\numplotsofactualtype}%
\csname pgfpmeta@\pgfplotspointmetainputhandler @activate\endcsname
\pgfplotsplothandlersurveystart
\pgfplotscoordstream@firstlast@init
@@ -3249,7 +3392,7 @@
\pgfplots@stacked@endplot
\fi
\ifx\pgfplots@currentplot@firstcoord@x\pgfutil@empty
- \pgfplots@warning{the current plot has no coordinates (or all have been filtered away)}%
+ \pgfplotswarning{plot without coordinates}\pgfeov%
\else
% Idea: use
% \scope[plot specification]
@@ -3294,7 +3437,7 @@
\noexpand\def\noexpand\plotnum{\the\pgfplots@numplots}%
%
% store \plotnumofactualtype
- \noexpand\def\noexpand\plotnumofactualtype{\numplotsofactualtype}%
+ \noexpand\def\noexpand\plotnumofactualtype{\plotnumofactualtype}%
% ... and make sure that it
% remains the same type even if some plot handler uses
% other plot handlers internally:
@@ -3912,7 +4055,7 @@
{\pgfplots@error@coord}%
}%
\let\pgfplots@error@coord=\pgfmathresult
- \pgfplotscoordmath{#1}{multiply}{%
+ \pgfplotscoordmath{#1}{op}{multiply}{%
{\csname pgfplots@current@point@#1\endcsname}
{\pgfplots@error@coord}%
}%
@@ -4129,7 +4272,7 @@
\ifx\pgfplots@perpointmeta@unboundedwarning@stop\relax
\begingroup
\pgfplotscoordmath{meta}{tostring}{##1}%
- \pgfplots@warning{The per point meta data `\pgfmathresult' (##1) (and probably others as well) is unbounded - using the minimum value instead.}%
+ \pgfplotswarning{point meta unbounded}{\pgfmathresult}{##1}\pgfeov
\endgroup
\gdef\pgfplots@perpointmeta@unboundedwarning@stop{1}%
\fi
@@ -4263,17 +4406,19 @@
%
% @see also \pgfplotsaxisifhaspointmeta
\def\pgfplotsaxisvisphasetransformpointmeta{%
- \ifx\pgfplots@current@point@meta\pgfutil@empty%
- \pgfplots@error{could not access the 'point meta' (used for example by scatter plots and color maps). Maybe you need to add '\string\addplot[point meta=y]' or something like that?}%
- \pgfplotscoordmath{meta}{one}%
- \let\pgfplotspointmeta=\pgfmathresult
- \def\pgfplotspointmetatransformed{1.0}%
+ \if1\csname pgfpmeta@\pgfplotspointmetainputhandler @issymbolic\endcsname
+ % symbolic point meta may be empty.
+ \let\pgfplotspointmeta=\pgfplots@current@point@meta
+ \let\pgfplotspointmetatransformed=\pgfplotspointmeta
\else
- % prepare arguments:
- \if1\csname pgfpmeta@\pgfplotspointmetainputhandler @issymbolic\endcsname
- \let\pgfplotspointmeta=\pgfplots@current@point@meta
- \let\pgfplotspointmetatransformed=\pgfplotspointmeta
+ % numeric point meta may NOT be empty.
+ \ifx\pgfplots@current@point@meta\pgfutil@empty%
+ \pgfplots@error{could not access the 'point meta' (used for example by scatter plots and color maps). Maybe you need to add '\string\addplot[point meta=y]' or something like that?}%
+ \pgfplotscoordmath{meta}{one}%
+ \let\pgfplotspointmeta=\pgfmathresult
+ \def\pgfplotspointmetatransformed{1.0}%
\else
+ % prepare arguments:
\let\pgfplotspointmeta=\pgfplots@current@point@meta
\pgfplots@perpointmeta@trafo{\pgfplotspointmeta}%
\let\pgfplotspointmetatransformed=\pgfmathresult
@@ -4629,14 +4774,20 @@
\pgfplots@validate@plot@domain@arguments
}
-\long\def\pgfplotsplothandlersurveyaddoptions#1{%
- \pgfplotsset{/pgfplots/execute at end survey/.add={}{%
+\long\def\pgfplotssurveyphaseaddoptionsbeforesurveybegins#1{%
+ \pgfplotsset{%
+ /pgfplots/execute at end survey/.add={}{%
\t@pgfplots@tokc=\expandafter{\pgfplots@addplot@survey@@optionlist,#1}% this allows '#' inside of '#1'
\edef\pgfplots@addplot@survey@@optionlist{\the\t@pgfplots@tokc}%
},%
#1%
}%
}%
+\long\def\pgfplotsplothandlersurveyaddoptions#1{%
+ \t@pgfplots@tokc=\expandafter{\pgfplots@addplot@survey@@optionlist,#1}% this allows '#' inside of '#1'
+ \edef\pgfplots@addplot@survey@@optionlist{\the\t@pgfplots@tokc}%
+ \pgfplotsset{#1}%
+}%
% The main interface to draw a plot into an axis.
@@ -5171,7 +5322,7 @@
% This prepares the implementation for 'patch type sampling':
\def\pgfplots@plot@expression@prepare@patch@type@sampling{%
- \pgfplotsplothandlersurveyaddoptions{
+ \pgfplotssurveyphaseaddoptionsbeforesurveybegins{
mesh input=patches,%
}%
%
@@ -5404,7 +5555,7 @@
\immediate\write18{gnuplot -V >\pgfplots@plot@filename.vrs}%
\openin\r@pgfplots@reada=\pgfplots@plot@filename.vrs\relax
\ifeof\r@pgfplots@reada
- \pgfplots@warning{Sorry, I could not determine 'gnuplot -V' to check whether gnuplot and logscale writes results in log() or not. Please set `/pgfplots/gnuplot writes logscale=true|false' manually.}%
+ \pgfplotswarning{gnuplot -V impossible}\pgfeov
\gdef\pgfplots@gnuplot@logscale@writes@log{1}% something doesn't work. set it somehow.
\else
\read\r@pgfplots@reada to\pgfplots@loc@TMPa
@@ -5423,7 +5574,7 @@
}%
\long\def\pgfplots@identify@gnuplot@logbehavior@checkversion@{%
\pgfutil@ifnextchar\par{%
- \pgfplots@warning{Sorry, I can't reliably check which version of gnuplot is available. I guess it is gnuplot < 4.4. Please set `/pgfplots/gnuplot writes logscale=true|false' manually if anything fails.}%
+ \pgfplotswarning{gnuplot -V format unknown}\pgfeov%
\gdef\pgfplots@gnuplot@logscale@writes@log{1}%
\pgfplots@identify@gnuplot@logbehavior@checkversion@@@
}{%
@@ -7882,8 +8033,7 @@
%
%
\if1\b@pgfplots@compat@plot@graphics@threedim
- \pgfplots@warning{plot3 graphics is running in backwards compatibility mode. %
- Use \string\pgfplotsset{compat=1.6} or higher to benefit from upgraded scaling capabilites.}%
+ \pgfplotswarning{plot3 graphics compatibility mode}\pgfeov%
\else
\fi
%
@@ -8089,7 +8239,7 @@
%
\ifx\pgfplots@plot@handler@graphics@pointmap@C@canvas\pgfutil@empty
\ifpgfplots@threedim
- \pgfplots@warning{plot graphics in 3D axis has just two inner anchors (those with '(x,y,z)=>(imgx,imgy)'). You should provide a third one such that I can check for correct scaling.}%
+ \pgfplotswarning{plot3 graphics too few inner anchors}\pgfeov%
\fi
\else
\pgfplots@plot@handler@graphics@pointmap@sanitize@scaling{C}%
@@ -8722,7 +8872,7 @@
% now, check again:
\pgfutil@ifundefined{pgfp@scatter@class@\pgfplotspointmeta}{%
\pgfutil@ifundefined{pgfp@scatter@WARNING@\pgfplotspointmeta}{%
- \pgfplots@warning{scatter/classes: can't find class for '\pgfplotspointmeta'!? Please make sure you have specified 'scatter src=explicit symbolic'. Ignoring class '\pgfplotspointmeta' (this message will not come again).}%
+ \pgfplotswarning{scatter classes no such class}\pgfplotspointmeta\pgfeov%
\expandafter\gdef\csname pgfp@scatter@WARNING@\pgfplotspointmeta\endcsname{ALREADY CHECKED}%
}{}%
\def\pgfplots@loc@TMPa{}%