summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex360
1 files changed, 322 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
index 4e00a678252..7d08f6667cb 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
@@ -37,21 +37,25 @@
% 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
+% \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
@@ -93,6 +97,7 @@
\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}%
}%
@@ -100,6 +105,7 @@
\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}%
}%
@@ -107,6 +113,7 @@
\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}%
}%
@@ -114,6 +121,7 @@
\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}%
}%
@@ -121,6 +129,7 @@
\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}%
}%
@@ -128,6 +137,7 @@
\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}%
}%
@@ -136,12 +146,12 @@
% \pgfplotspointonorientedsurfaceabsetupforzyx and
% \pgfplotspointonorientedsurfaceabsetupforyzx.
%
-% #1: The fixed value for 'x'.
+% #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.
+% 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}%
@@ -162,6 +172,7 @@
\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}%
}%
@@ -170,6 +181,7 @@
\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}%
}%
@@ -181,7 +193,7 @@
% - b=1: 'v01'
% - b=2: 'v02'
%
-% To check which of them should be drawn, this macro here convert 'a'
+% 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'.
@@ -341,8 +353,8 @@
% oriented.
% #3 The return value is encoded as integer into the macro #3 as
% described in \pgfplotspointonorientedsurfaceabmatchaxisline:
-% '#3' will be EMPTY if '#1' NOT in '#2'.
-% '#3' will be NON-EMPTY if '#1' IN '#2'.
+% '#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
@@ -460,7 +472,8 @@
% 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).
-% - \pgfplots@[xyz]@veclength
+% - [xyz] vectors,
+% \pgfplots@[xyz]@veclength,
% \pgfplots@[xyz]@inverseveclength
% are set properly
\def\pgfplotssetaxesfrompitchyaw#1#2#3{%
@@ -494,21 +507,152 @@
\def\pgfplots@x@inverseveclength{1.0}%
\def\pgfplots@y@inverseveclength{1.0}%
\def\pgfplots@z@inverseveclength{1.0}%
-% FIXME :
-\def\scale{200}%
-\pgfmathreciprocal@{\scale}%
-\let\invscale=\pgfmathresult
-\pgfsetxvec{\pgfpointscale{\scale}{\pgfplots@glob@TMPa}}%
-\pgfsetyvec{\pgfpointscale{\scale}{\pgfplots@glob@TMPb}}%
-\pgfsetzvec{\pgfpointscale{\scale}{\pgfplots@glob@TMPc}}%
-\let\pgfplots@x@veclength=\scale%
-\let\pgfplots@y@veclength=\scale%
-\let\pgfplots@z@veclength=\scale%
-\let\pgfplots@x@inverseveclength=\invscale%
-\let\pgfplots@y@inverseveclength=\invscale%
-\let\pgfplots@z@inverseveclength=\invscale%
+\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.
@@ -666,7 +810,10 @@
% point meta/explicit : parse the information found
% somewhere:
\def\pgfplots@set@perpointmeta{%
- \pgfmathfloatparsenumber{\pgfplots@current@point@meta}%
+ \ifx\pgfplots@current@point@meta\pgfutil@empty
+ \else
+ \pgfmathfloatparsenumber{\pgfplots@current@point@meta}%
+ \fi
\let\pgfplots@current@point@meta=\pgfmathresult
}%
\or
@@ -694,10 +841,13 @@
\global\let\pgfplots@metamax=\pgfplots@invalidrange@metamax
\expandafter\def\expandafter\pgfplots@set@perpointmeta\expandafter{%
\pgfplots@set@perpointmeta
- \pgfplotsmathfloatmin{\pgfplots@metamin}{\pgfplots@current@point@meta}%
- \global\let\pgfplots@metamin=\pgfmathresult
- \pgfplotsmathfloatmax{\pgfplots@metamax}{\pgfplots@current@point@meta}%
- \global\let\pgfplots@metamax=\pgfmathresult
+ \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}%
@@ -706,10 +856,13 @@
\global\let\pgfplots@metamax=\pgfplots@invalidrange@metamax
\expandafter\def\expandafter\pgfplots@set@perpointmeta\expandafter{%
\pgfplots@set@perpointmeta
- \pgfplotsmathmin{\pgfplots@metamin}{\pgfplots@current@point@meta}%
- \global\let\pgfplots@metamin=\pgfmathresult
- \pgfplotsmathmax{\pgfplots@metamax}{\pgfplots@current@point@meta}%
- \global\let\pgfplots@metamax=\pgfmathresult
+ \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
@@ -1226,7 +1379,9 @@
\t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPa}%
\xdef\pgfplots@glob@TMPa{%
\the\t@pgfplots@toka
- {% coordinates which need to be processed in \endaxis:
+ {% 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
}%
}%
@@ -1633,7 +1788,7 @@
\pgfplots@addplotimpl@expression@e{#1}{#2}%
}{%
\pgfutil@ifnextchar g{%
- \pgfplots@addplotimpl@gnuplot{#1}{#2}%
+ \pgfplots@addplotimpl@g{#1}{#2}%
}{%
\pgfplots@error{Sorry, the supplied plot command is unknown or unsupported by pgfplots! Ignoring it.}%
\pgfplots@gobble@until@semicolon
@@ -1723,9 +1878,9 @@
%
\ifpgfplots@curplot@threedim
\pgfkeysgetvalue{/pgfplots/y domain}{\pgfplots@plot@ydomain}%
- \def\pgfplots@addplotimpl@expression@split@yz##1,##3\pgfplots@EOI{%
+ \def\pgfplots@addplotimpl@expression@split@yz##1,##2\pgfplots@EOI{%
\def\pgfplots@addplotimpl@expression@yEXPR{##1}%
- \def\pgfplots@addplotimpl@expression@zEXPR{##3}%
+ \def\pgfplots@addplotimpl@expression@zEXPR{##2}%
}%
\pgfplots@addplotimpl@expression@split@yz#4\pgfplots@EOI%
\ifx\pgfplots@plot@ydomain\pgfutil@empty
@@ -1859,9 +2014,16 @@
\catcode`\;=12
\xdef\pgfplots@gnuplot@format{set format "%.7e";}
}
+\def\pgfplots@addplotimpl@g#1#2g{%
+ \pgfutil@ifnextchar r{%
+ \pgfplots@addplotimpl@graphics{#1}{#2}%
+ }{%
+ \pgfplots@addplotimpl@gnuplot{#1}{#2}%
+ }%
+}%
% |\addplot gnuplot| is an alias to |\addplot function|
-\def\pgfplots@addplotimpl@gnuplot#1#2gnuplot{\pgfplots@addplotimpl@function{#1}{#2}unction}%
+\def\pgfplots@addplotimpl@gnuplot#1#2nuplot{\pgfplots@addplotimpl@function{#1}{#2}unction}%
% \addplot[<style options>]
% plot[<behavior opts>]
@@ -2071,6 +2233,51 @@
\pgfplots@coord@stream@coord%
}%
+
+\def\pgfplots@addplotimpl@graphics#1#2raphics{%
+ \pgfutil@ifnextchar[{%
+ \pgfplots@addplotimpl@graphics@{#1}{#2}%
+ }{%
+ \pgfplots@addplotimpl@graphics@{#1}{#2}[]%
+ }%
+}%
+% \addplot[#1] plot[#2] graphics[#3] {#4} #5;
+\def\pgfplots@addplotimpl@graphics@#1#2[#3]#4#5;{\pgfplots@addplotimpl@graphics@@{#1}{#2}{#3}{#4}{#5}}%
+\def\pgfplots@addplotimpl@graphics@@#1#2#3#4#5{%
+ \pgfplots@start@plot@with@behavioroptions{#2,/pgfplots/plot graphics/.cd,#3,/pgfplots/plot graphics/src={#4}}%
+ \pgfplots@PREPARE@COORD@STREAM{#1,/pgfplots/plot graphics,/tikz/mark=}{#5}%
+ \pgfplots@coord@stream@start
+ \pgfkeysgetvalue{/pgfplots/plot graphics/xmin}{\pgfplots@current@point@x}%
+ \pgfkeysgetvalue{/pgfplots/plot graphics/ymin}{\pgfplots@current@point@y}%
+ \ifx\pgfplots@current@point@x\pgfutil@empty\pgfplots@addplotimpl@graphics@@error{xmin}\fi
+ \ifx\pgfplots@current@point@y\pgfutil@empty\pgfplots@addplotimpl@graphics@@error{ymin}\fi
+ \ifpgfplots@curplot@threedim
+ \pgfkeysgetvalue{/pgfplots/plot graphics/zmin}{\pgfplots@current@point@z}%
+ \ifx\pgfplots@current@point@z\pgfutil@empty\pgfplots@addplotimpl@graphics@@error{zmin}\fi
+ \fi
+ \pgfplots@coord@stream@coord
+ %
+ \pgfkeysgetvalue{/pgfplots/plot graphics/xmax}{\pgfplots@current@point@x}%
+ \pgfkeysgetvalue{/pgfplots/plot graphics/ymax}{\pgfplots@current@point@y}%
+ \ifx\pgfplots@current@point@x\pgfutil@empty\pgfplots@addplotimpl@graphics@@error{xmax}\fi
+ \ifx\pgfplots@current@point@y\pgfutil@empty\pgfplots@addplotimpl@graphics@@error{ymax}\fi
+ \ifpgfplots@curplot@threedim
+ \pgfkeysgetvalue{/pgfplots/plot graphics/zmax}{\pgfplots@current@point@z}%
+ \ifx\pgfplots@current@point@z\pgfutil@empty\pgfplots@addplotimpl@graphics@@error{zmax}\fi
+ \fi
+ \pgfplots@coord@stream@coord
+ %
+ \pgfplots@coord@stream@end
+}%
+\def\pgfplots@addplotimpl@graphics@@error#1{%
+ \begingroup
+ \pgfplots@error{Sorry, but 'plot graphics' can't determine where to place the graphics file - (at least) the key '#1' is missing. Please verify that you provided all required limits, for example 'plot graphics[xmin=0,xmax=1,ymin=0,ymax=1] {<graphics>}'.}%
+ \endgroup
+}%
+
+
+
+
\def\pgfplots@addplotimpl@table#1table{%
\pgfutil@ifnextchar[{%
\pgfplots@addplotimpl@table@getopts{#1}%
@@ -2517,6 +2724,7 @@
\let\pgfplots@addplotimpl@file@opt@IS=\pgfplots@addplotimpl@file@opt
\let\pgfplots@addplotimpl@table@fromstructure@IS=\pgfplots@addplotimpl@table@fromstructure
\let\pgfplots@addplotimpl@table@fromfile@IS=\pgfplots@addplotimpl@table@fromfile
+ \let\pgfplots@addplotimpl@graphics@IS=\pgfplots@addplotimpl@graphics@
\let\pgfplots@addplotimpl@coordinates@IS=\pgfplots@addplotimpl@coordinates
%
\def\pgfplots@gobble@until@semicolon@AS#1;{}
@@ -2527,6 +2735,7 @@
\long\def\pgfplots@addplotimpl@table@fromstructure@AS#1#2from#3#4;{\pgfplots@addplotimpl@table@startprocessing{#1}{#2}{#3}{#4}}%
\long\def\pgfplots@addplotimpl@table@fromfile@AS#1#2#3#4;{\pgfplots@addplotimpl@table@startprocessing{#1}{#2}{#3}{#4}}%
\long\def\pgfplots@addplotimpl@coordinates@AS#1#2plot coordinates#3#4;{\pgfplots@addplotimpl@coordinates@{#1}{#2}{#3}{#4}}%
+ \def\pgfplots@addplotimpl@graphics@AS#1#2[#3]#4#5;{\pgfplots@addplotimpl@graphics@@{#1}{#2}{#3}{#4}{#5}}%
%
% Checks whether ';' is an active character and, if that is the
% case, modifies all public macros for it.
@@ -2539,6 +2748,7 @@
\let\pgfplots@addplotimpl@table@fromstructure=\pgfplots@addplotimpl@table@fromstructure@AS
\let\pgfplots@addplotimpl@table@fromfile=\pgfplots@addplotimpl@table@fromfile@AS
\let\pgfplots@addplotimpl@coordinates=\pgfplots@addplotimpl@coordinates@AS
+ \let\pgfplots@addplotimpl@graphics@=\pgfplots@addplotimpl@graphics@AS
}%
}
@@ -2888,8 +3098,8 @@
\def\pgfplots@install@plotmark@handler{%
\pgfplots@assert@tikzinternal@exists{tikz@options}%
- % note: I can't check on tikz@transform because it can be
- % '\relax'.
+ \pgfplots@assert@tikzinternal@exists{tikz@mode}%
+ % note: I can't check on tikz@transform because it can be '\relax'.
\pgfplots@gettikzinternal@keyval{mark indices}{tikz@mark@list}{}%
\pgfplots@gettikzinternal@keyval{mark}{tikz@plot@mark}{}%
%
@@ -2898,7 +3108,29 @@
%\let\tikz@options=\pgfutil@empty%
\let\tikz@transform=\pgfutil@empty%
\tikzset{every plot/.try,every mark}%
+ %
+ % This sets colors:
\tikz@options
+ %
+ % This sets the \iftikz@mode@draw etc:
+ %\tikz@mode
+ % FIXME: using 'color=blue' will NOT activate filltrue!
+ % So: if 'tikz@mode' *contains* 'fillfalse', I know what to do...
+ % but all other cases are not clear
+ %--------------------------------------------------
+ % \iftikz@mode@draw
+ % \else
+ % % Override the marker codes: force 'draw=none'
+ % % even if the markers likes to be stroked:
+ % \let\pgfusepathqfillstroke=\pgfusepathqfill
+ % \fi
+ % \iftikz@mode@fill
+ % \else
+ % % Override the marker codes: force 'fill=none'
+ % % even if the markers likes to be filled:
+ % \let\pgfusepathqfillstroke=\pgfusepathqstroke
+ % \fi
+ %--------------------------------------------------
\pgfplots@perpointmeta@preparetrafo
% this here is the MAIN marker code.
% It may be modified if scatter plot is enabled, see below.
@@ -3249,3 +3481,55 @@
\endpgfinterruptboundingbox%
}%
+
+
+\def\pgfplotsplothandlergraphics{%
+ \def\pgf@plotstreamstart{%
+ \global\let\pgfplots@plot@handler@graphics@bb@first=\pgfutil@empty
+ \global\let\pgfplots@plot@handler@graphics@bb@second=\pgfutil@empty
+ \global\let\pgf@plotstreampoint=\pgfplots@plot@handler@graphics@collectbb%
+ \global\let\pgf@plotstreamspecial=\pgfutil@gobble%
+ \global\let\pgf@plotstreamend=\pgfplots@plot@handler@graphics@finish%
+ }%
+}%
+\def\pgfplots@plot@handler@graphics@collectbb#1{%
+ \pgf@process{#1}%
+ \ifx\pgfplots@plot@handler@graphics@bb@first\pgfutil@empty
+ % ok, this is the lower left corner.
+ \xdef\pgfplots@plot@handler@graphics@bb@first{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \else
+ \ifx\pgfplots@plot@handler@graphics@bb@second\pgfutil@empty
+ % ok, this is the upper right corner.
+ \xdef\pgfplots@plot@handler@graphics@bb@second{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \else
+ \pgfplots@error{Error using 'plot graphics': I encountered more than two coordinates!? I expected only the lower left and upper right corners!}%
+ \fi
+ \fi
+}%
+\def\pgfplots@plot@handler@graphics@finish{%
+ \ifx\pgfplots@plot@handler@graphics@bb@first\pgfutil@empty
+ \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}}%
+
+ \fi
+ \ifx\pgfplots@plot@handler@graphics@bb@second\pgfutil@empty
+ \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@second{\noexpand\pgfqpoint{0pt}{0pt}}%
+ \fi
+ \pgfpointdiff{\pgfplots@plot@handler@graphics@bb@first}{\pgfplots@plot@handler@graphics@bb@second}%
+ \edef\pgfplots@loc@TMPa{\the\pgf@x}% width
+ \edef\pgfplots@loc@TMPb{\the\pgf@y}% height
+ \pgfkeysgetvalue{/pgfplots/plot graphics/includegraphics}{\pgfplots@loc@TMPc}%
+ \pgfkeysgetvalue{/pgfplots/plot graphics/src}{\pgfplots@loc@TMPd}%
+ \ifx\pgfplots@loc@TMPd\pgfutil@empty
+ \pgfplots@error{Error using 'plot graphics': I don't have a graphics file name! Please set the '/pgfplots/plot graphics/src' key to the image file name. Skipping this plot.}%
+ \else
+ \begingroup
+ \pgftransformshift{\pgfplots@plot@handler@graphics@bb@first}%
+ \node[/pgfplots/plot graphics/node,rectangle] {%
+ \expandafter\includegraphics\expandafter[\pgfplots@loc@TMPc,width=\pgfplots@loc@TMPa,height=\pgfplots@loc@TMPb]{\pgfplots@loc@TMPd}%
+ };%
+ \endgroup
+ \fi
+}%
+