diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex index 9ca915d5981..3e019c5feec 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex @@ -7,7 +7,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseplot.code.tex,v 1.5 2006/10/16 22:32:58 tantau Exp $ +\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseplot.code.tex,v 1.7 2007/05/02 14:08:27 tantau Exp $ % PGF's plotting interface works as follows: @@ -198,10 +198,11 @@ \endgroup% } +\let\pgf@savedpar=\par% \def\pgf@partext{\par} \def\pgf@readxyfile{% \read1 to \pgf@temp% - \let\par=\@@par% + \let\par=\pgf@savedpar% \edef\pgf@temp{\pgf@temp}% \ifx\pgf@temp\pgfutil@empty% \else\ifx\pgf@temp\pgf@partext% @@ -294,15 +295,15 @@ \def\pgf@plotgnuplot[#1]#2{% \pgf@resample@plottrue% % Check, whether it is up-to-date - \openin\@inputcheck=#1.gnuplot - \ifeof\@inputcheck% + \openin\pgfutil@inputcheck=#1.gnuplot + \ifeof\pgfutil@inputcheck% \else% - \read\@inputcheck to\pgf@temp% ignored - \read\@inputcheck to\pgf@plot@line% + \read\pgfutil@inputcheck to\pgf@temp% ignored + \read\pgfutil@inputcheck to\pgf@plot@line% \edef\pgf@plot@code{#2\space}% \ifx\pgf@plot@code\pgf@plot@line% - \openin\@inputcheck=#1.table - \ifeof\@inputcheck% + \openin\pgfutil@inputcheck=#1.table + \ifeof\pgfutil@inputcheck% \else% \pgf@resample@plotfalse% \fi% @@ -320,5 +321,37 @@ +% This producer handler plots a function using pgf's mathematical engine. +% +% #1 = variable +% #2 = domain for the variable +% #3 = point, typically defined in terms of the value of the variable +% +% Description: +% +% This producer will iterate the variable #1 over all variables in #2 +% (using the \foreach statement). For each value, a plot coordinate +% #3 is created. +% +% Note that this command is pretty slow. +% +% Example: +% +% \pgfplothandlerlineto +% \pgfplotfunction{\x}{0,0.1,...,3.141}{\pgfpointxy{\x}{sin(\x)}} + +\def\pgfplotfunction#1#2#3{% + \pgfplotstreamstart% + \foreach#1in{#2}% + {% + \pgf@process{#3}% + \edef\pgf@marshal{\noexpand\pgfplotstreampoint{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}% + \pgf@marshal% + } + \pgfplotstreamend% +} + + + \endinput |