diff options
author | Karl Berry <karl@freefriends.org> | 2012-10-26 21:36:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-10-26 21:36:14 +0000 |
commit | 4147899f17a6e0b0dde20f309845c4fc0032bce9 (patch) | |
tree | 3609a0dc99736d7a2081187b9e12e9bac63c6bb6 /Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex | |
parent | 3d12d871ae8a0e941fb2521bdc99ce436aeb17c6 (diff) |
pgfplots (26oct12)
git-svn-id: svn://tug.org/texlive/trunk@28094 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.tex | 187 |
1 files changed, 160 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex index a80e77884ce..a6fa1eae255 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex @@ -2609,7 +2609,7 @@ }% \def\pgfplotscoordstream@firstlast@update{% \ifx\pgfplots@current@point@x\pgfutil@empty - % only one \if is enough as ONE empty coordinate results all + % only one \if is enough as ONE empty coordinate causes all % others to be reset as well. \else \ifx\pgfplots@currentplot@firstcoord@x\pgfutil@empty @@ -4509,12 +4509,13 @@ \def\pgfplots@coord@stream@foreach@NORMALIZED@curencoded@braced{{#1}}% \pgfplotsaxisdeserializedatapointfrom{#1}% \pgfplots@coord@stream@coord - \pgfplotscoordstream@firstlast@update + \pgfplotsplothandlerifcurrentpointcanbefirstlast{% + \pgfplotscoordstream@firstlast@update + }{}% \expandafter\pgfplots@foreach@plot@coord@NORMALIZED@ITERATE \fi } - % A common routine which resets internal data structures for the % survey phase, i.e. it is the shared implementation for all \addplot % variations. @@ -4946,6 +4947,8 @@ % \foreach because \foreach does NOT allow extended % precision. Besides, \pgfplotsforeachungrouped avoids % scoping problems. + \let\pgfplots@plot@data@notify@next@x=\relax + \let\pgfplots@plot@data@notify@next@y=\relax % \ifpgfplots@curplot@threedim \def\pgfplots@addplotimpl@expression@split@yz##1,##2\pgfplots@EOI{% @@ -4971,7 +4974,11 @@ \edef\pgfplots@plot@data##1{% \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\pgfplots@plot@var@y in {\pgfplots@expression@ydomain} {% - \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {##1}% + \pgfplots@plot@data@notify@next@y + \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {% + \pgfplots@plot@data@notify@next@x + ##1% + }% \noexpand\pgfplotsplothandlernotifyscanlinecomplete }% }% @@ -4979,7 +4986,11 @@ % sample a line: \def\pgfplots@plot@ydomain{0:0}% \edef\pgfplots@plot@data##1{% - \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {##1}}% + \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@expression@xdomain} {% + \pgfplots@plot@data@notify@next@x + ##1% + }% + }% % % If we have (\x,\y,f(x)), use (\x,0,f(x)) instead and % suppress the error message which would occur for \y. @@ -5015,7 +5026,12 @@ \edef\pgfplots@plot@data##1{% \noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots@plot@samples] \expandafter\noexpand\tikz@plot@var/\noexpand\pgfplots@current@point@x@log - in {\pgfplots@plot@domain} {##1}}% + in {\pgfplots@plot@domain}% + {% + \pgfplots@plot@data@notify@next@x + ##1% + }% + }% % we have a logarithmic sampling sequence, % \pgfplots@current@point@x@log is already available % logarithmic! We can safe time and accuracy for the x @@ -5045,8 +5061,13 @@ % use 'samples at': \let\pgfplots@loc@TMPa=\pgfplots@plot@samples@at \fi - \edef\pgfplots@plot@data##1{ - \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@loc@TMPa} {##1}}% + \edef\pgfplots@plot@data##1{% + \noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz@plot@var in {\pgfplots@loc@TMPa}% + {% + \pgfplots@plot@data@notify@next@x + ##1% + }% + }% \fi \expandafter\def\pgfplots@plot@var@y{0}% \def\pgfplots@addplotimpl@expression@yEXPR{#4}% @@ -5080,6 +5101,13 @@ \let\pgfplots@addplotimpl@expression@pseudoconst@x=\pgfmathx@ \let\pgfplots@addplotimpl@expression@pseudoconst@y=\pgfmathy@ % +% \if n\pgfplots@meshmode + % mesh=false : ignore patch type sampling. +% \else + \ifpgfplotsplothandlermesh@patch@type@sampling + \pgfplots@plot@expression@prepare@patch@type@sampling + \fi +% \fi % % Warning for use fpu=false: evaluation '\x^3' might be different from 'x^3' for % negative arguments: @@ -5141,6 +5169,87 @@ }% +% This prepares the implementation for 'patch type sampling': +\def\pgfplots@plot@expression@prepare@patch@type@sampling{% + \pgfplotsplothandlersurveyaddoptions{ + mesh input=patches,% + }% + % + \pgfkeysgetvalue{/pgfplots/patch type}\pgfplotsplothandlermesh@patchclass + % + \let\pgfplots@plot@data@@=\pgfplots@plot@data + \let\pgfplots@plot@data@curx=\pgfutil@empty + \let\pgfplots@plot@data@cury=\pgfutil@empty + \let\pgfplots@plot@data@lastx=\pgfutil@empty + \let\pgfplots@plot@data@lasty=\pgfutil@empty + \let\pgfplots@plot@data@first@x=\pgfutil@empty + \let\pgfplots@plot@data@first@y=\pgfutil@empty + % + \def\pgfplots@plot@data@notify@next@x{% + \ifx\pgfplots@plot@data@first@x\pgfutil@empty + \edef\pgfplots@plot@data@first@x{\tikz@plot@var}% + \fi + \let\pgfplots@plot@data@lastx=\pgfplots@plot@data@curx + \edef\pgfplots@plot@data@curx{\tikz@plot@var}% + }% + \def\pgfplots@plot@data@notify@next@y{% + \ifx\pgfplots@plot@data@first@y\pgfutil@empty + \edef\pgfplots@plot@data@first@y{\pgfplots@plot@var@y}% + \fi + \let\pgfplots@plot@data@lasty=\pgfplots@plot@data@cury + \edef\pgfplots@plot@data@cury{\pgfplots@plot@var@y}% + }% + \def\pgfplots@plot@data##1{% + % + \pgfplots@plot@data@@{% + \let\tikz@plot@var@old=\tikz@plot@var + \let\pgfplots@plot@var@y@old=\pgfplots@plot@var@y + % + % + % + % boolean 'if is first row || is first cell': + \pgfplots@loc@tmpfalse + \ifx\pgfplots@plot@data@curx\pgfplots@plot@data@first@x + % ah - we have the first row. + \pgfplots@loc@tmptrue + \fi + \if0\b@pgfplots@should@sample@LINE + \ifx\pgfplots@plot@data@cury\pgfplots@plot@data@first@y + % ah - we have the first cell. + \pgfplots@loc@tmptrue + \fi + \fi + % + \ifpgfplots@loc@tmp + \else + \pgfmathparse{\pgfplots@plot@data@curx-\pgfplots@plot@data@lastx}% + \let\pgfplots@plot@data@hx=\pgfmathresult + % + \if0\b@pgfplots@should@sample@LINE + \pgfmathparse{\pgfplots@plot@data@cury-\pgfplots@plot@data@lasty}% + \let\pgfplots@plot@data@hy=\pgfmathresult + \fi + % + \def\pgfplotspatchready{\pgfplotsscanlinecomplete}% + \pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{sample in unit cube}{% + \pgfmathparse{\pgfplots@plot@data@lastx + \pgfplotspatchclassx*\pgfplots@plot@data@hx}% + \let\tikz@plot@var=\pgfmathresult + % + \if0\b@pgfplots@should@sample@LINE + \pgfmathparse{\pgfplots@plot@data@lasty + \pgfplotspatchclassy*\pgfplots@plot@data@hy}% + \let\pgfplots@plot@var@y=\pgfmathresult + \fi + % + ##1% + % + \let\tikz@plot@var=\tikz@plot@var@old + \let\pgfplots@plot@var@y=\pgfplots@plot@var@y@old + }% + \fi + }% + }% +}% + \let\pgfplots@backupof@pgfplotxyfile=\pgfplotxyfile % the following code @@ -7018,7 +7127,7 @@ \tikzset{every plot/.try}% \pgfplots@coord@stream@INIT@finalize@storedcoords\pgfplots@recorded@marker@stream% \expandafter\pgfplots@coord@stream@foreach@NORMALIZED\expandafter{\pgfplots@coord@stream@finalize@storedcoords@START@coords}% - \pgfutil@ifundefined{pgfplotlastpoint}{}{% + \pgfutil@IfUndefined{pgfplotlastpoint}{}{% \tikz@make@last@position{\pgfplotlastpoint}% }% \let\pgfplots@plot@timer@args=\pgfplots@coord@stream@finalize@storedcoords@START@coords @@ -7608,11 +7717,14 @@ \ifx\pgfplots@plot@handler@graphics@pointmap@D@img\pgfutil@empty \else \pgfkeysgetvalue{/pgfplots/plot graphics/debug}\pgfplots@loc@TMPa - \def\pgfplots@loc@TMPb{true}% + \def\pgfplots@loc@TMPb{false}% + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \let\pgfplots@loc@TMPa=\pgfplots@loc@TMPb + \fi \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb - \def\pgfplotsplothandlergraphicspointmapcomputerequiredview@debug{1}% - \else \def\pgfplotsplothandlergraphicspointmapcomputerequiredview@debug{0}% + \else + \def\pgfplotsplothandlergraphicspointmapcomputerequiredview@debug{1}% \fi % The following implementation computes the 'unit vector % ratio' of the IMAGE. @@ -7802,7 +7914,7 @@ \if1\pgfplotsplothandlergraphicspointmapcomputerequiredview@debug See \the\t@pgfplots@tokc.dat for debug output. \else - Use 'plot graphics[debug] to generate debug output files. + Use 'plot graphics[debug]' or 'plot graphics[debug=visual]' to generate debug output files. \fi ^^J}% \endgroup @@ -7839,6 +7951,7 @@ \immediate\write\w@pgf@writea{canvasmapmatrix=[\pgfplotsmatrix@text];^^Jcanvasmaprhs = [\pgfplotsrhs@text];^^J}% % \immediate\write\w@pgf@writea{key configuration = \pgfplotsretval;^^J}% + \immediate\write\w@pgf@writea{use debug=visual to see the mapped keys.^^J}% \immediate\closeout\w@pgf@writea \endgroup }% @@ -7963,6 +8076,17 @@ \pgfplots@plot@handler@graphics@DRAW@ };% \endgroup + % + % + \pgfkeysgetvalue{/pgfplots/plot graphics/debug}\pgfplots@loc@TMPa + \edef\pgfplots@loc@TMPb{visual}% + \ifx\pgfplots@loc@TMPb\pgfplots@loc@TMPa + % debug = visual: "sanitize" also triggers the visualization. + \pgfplots@plot@handler@graphics@pointmap@sanitize@scaling{A}% + \pgfplots@plot@handler@graphics@pointmap@sanitize@scaling{B}% + \fi + % + % \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.}% @@ -8026,24 +8150,33 @@ Please refer to the pgfplots manual for details. If you continue now, I'll show the points in the image}% \endgroup % + \pgfplots@plot@handler@graphics@pointmap@sanitize@scaling@draw % - \scope - \pgfsetstrokecolor{black}% - \pgfsetfillcolor{red}% - \pgfpathcircle{\pgfplots@point@canvas@check}{2pt}% - \pgfusepath{stroke,fill}% - \pgfsetfillcolor{green}% - \pgfpathcircle{\pgfplots@point@canvas}{2pt}% - \pgfusepath{stroke,fill}% - \draw[->,red] - \pgfextra{ - \pgfpathmoveto{\pgfplots@point@canvas@check}% - \pgfpathlineto{\pgfplots@point@canvas}}; - \endscope + \fi + \pgfkeysgetvalue{/pgfplots/plot graphics/debug}\pgfplots@loc@TMPa + \edef\pgfplots@loc@TMPb{visual}% + \ifx\pgfplots@loc@TMPb\pgfplots@loc@TMPa + \pgfplots@plot@handler@graphics@pointmap@sanitize@scaling@draw \fi \endgroup } +\def\pgfplots@plot@handler@graphics@pointmap@sanitize@scaling@draw{% + \scope + \pgfsetstrokecolor{black}% + \pgfsetfillcolor{red}% + \pgfpathcircle{\pgfplots@point@canvas@check}{2pt}% + \pgfusepath{stroke,fill}% + \pgfsetfillcolor{green}% + \pgfpathcircle{\pgfplots@point@canvas}{2pt}% + \pgfusepath{stroke,fill}% + \draw[->,red] + \pgfextra{ + \pgfpathmoveto{\pgfplots@point@canvas@check}% + \pgfpathlineto{\pgfplots@point@canvas}}; + \endscope +}% + \def\pgfplots@plot@handler@graphics@usebb{% \pgfpointdiff{\pgfplots@plot@handler@graphics@bb@first}{\pgfplots@plot@handler@graphics@bb@second}% \def\pgfplots@plot@handler@graphics@finish@ok{1}% @@ -8527,7 +8660,7 @@ % \pgfshell[\jobname]{cat table.dat} % \pgfplotxyfile{\jobname.out} -\pgfutil@ifundefined{w@pgf@writea}{% +\pgfutil@IfUndefined{w@pgf@writea}{% \csname newwrite\endcsname\pgf@shellwrite }{% \let\pgf@shellwrite=\w@pgf@writea |