diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex | 100 |
1 files changed, 98 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex index f93028724a3..af2c68353a7 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%% +%%% Date of this copy: Mi 14. Jul 21:31:43 CEST 2010 %%% @@ -27,7 +27,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplothandlers.code.tex,v 1.14 2009/11/18 20:27:45 ludewich Exp $ +\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryplothandlers.code.tex,v 1.15 2010/05/31 10:11:22 tantau Exp $ \newif\ifpgf@plot@started @@ -941,6 +941,102 @@ +% This handler turns creates a series of straight line segements +% between consecutive points, but leaving /pgf/gap around stream point +% space. +% +% Example: +% +% \pgfplothandlergaplineto +% \pgfplotxyfile{mytable} + +\pgfkeys{/pgf/gap around stream point/.initial=1.5pt} + +\def\pgfplothandlergaplineto{% + \def\pgf@plotstreamstart{% + \global\let\pgf@plotstreampoint=\pgf@plot@gap@lineto@handler@initial% + \global\let\pgf@plotstreamspecial=\pgfutil@gobble% + \global\let\pgf@plotstreamend=\relax% + }% +} + +\def\pgf@plot@gap@lineto@handler@initial#1{% + \pgf@process{#1}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \xdef\pgf@plot@gap@lineto@last{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}% + \global\let\pgf@plotstreampoint=\pgf@plot@gap@lineto@handler% +} + +\def\pgf@plot@gap@lineto@handler#1{% + % Ok, compute normalized line vector + \pgf@process{#1}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \xdef\pgf@plot@gap@lineto@next{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}% + \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgf@plot@gap@lineto@last}{\pgf@plot@gap@lineto@next}}}% + \pgf@xc=\pgf@x% + \pgf@yc=\pgf@y% + \pgfpathmoveto{\pgfpointadd{\pgfpointscale{\pgfkeysvalueof{/pgf/gap + around stream point}}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}{\pgf@plot@gap@lineto@last}}% + \pgfpathlineto{\pgfpointadd{\pgfpointscale{\pgfkeysvalueof{/pgf/gap + around stream point}}{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}}{\pgf@plot@gap@lineto@next}}% + \global\let\pgf@plot@gap@lineto@last=\pgf@plot@gap@lineto@next% +} + + + + +% This handler works like \pgfplothandlergaplineto, only the last +% point is connected to the first point, creating a closed curve +% space. +% +% Example: +% +% \pgfplothandlergapcycle +% \pgfplotxyfile{mytable} + +\def\pgfplothandlergapcycle{% + \def\pgf@plotstreamstart{% + \global\let\pgf@plotstreampoint=\pgf@plot@gap@cycle@handler@initial% + \global\let\pgf@plotstreamspecial=\pgfutil@gobble% + \global\let\pgf@plotstreamend=\pgf@plot@gap@cycle@handler@finish% + \global\let\pgf@plot@gap@cycle@first=\relax% + }% +} + +\def\pgf@plot@gap@cycle@handler@initial#1{% + \pgf@process{#1}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \xdef\pgf@plot@gap@cycle@last{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}% + \global\let\pgf@plot@gap@cycle@first=\pgf@plot@gap@cycle@last% + \global\let\pgf@plotstreampoint=\pgf@plot@gap@cycle@handler% +} + +\def\pgf@plot@gap@cycle@handler#1{% + % Ok, compute normalized line vector + \pgf@process{#1}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \xdef\pgf@plot@gap@cycle@next{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}% + \pgf@process{\pgfpointnormalised{\pgfpointdiff{\pgf@plot@gap@cycle@last}{\pgf@plot@gap@cycle@next}}}% + \pgf@xc=\pgf@x% + \pgf@yc=\pgf@y% + \pgfpathmoveto{\pgfpointadd{\pgfpointscale{\pgfkeysvalueof{/pgf/gap + around stream point}}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}{\pgf@plot@gap@cycle@last}}% + \pgfpathlineto{\pgfpointadd{\pgfpointscale{\pgfkeysvalueof{/pgf/gap + around stream point}}{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}}{\pgf@plot@gap@cycle@next}}% + \global\let\pgf@plot@gap@cycle@last=\pgf@plot@gap@cycle@next% +} + +\def\pgf@plot@gap@cycle@handler@finish{% + \ifx\pgf@plot@gap@cycle@first\relax% + \else + \pgf@plot@gap@cycle@handler{\pgf@plot@gap@cycle@first}% + \fi +} + \endinput |