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/pgfplotsplothandlers.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/pgfplotsplothandlers.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex | 76 |
1 files changed, 73 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex index 961362a1857..9d17a2e157d 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex @@ -404,7 +404,63 @@ \expandafter\pgfplotsplothandlers@init@\expandafter{\pgfplots@loc@TMPa}% }% % + \if1\b@pgfplots@compat@bar@width@units + \else + \def\pgfplotbarwidth{\pgfplots@bar@width@not@in@context}% + \def\pgfplotbarshift{\pgfplots@bar@shift@not@in@context}% + \pgfplotsutil@add@to@macro\pgfplothandlerxbar{% + \def\pgfplotbarwidth{\pgfplots@xbar@width}% + \def\pgfplotbarshift{\pgfplots@xbar@shift}% + }% + \pgfplotsutil@add@to@macro\pgfplothandlerybar{% + \def\pgfplotbarwidth{\pgfplots@ybar@width}% + \def\pgfplotbarshift{\pgfplots@ybar@shift}% + }% + \fi + % \pgfplotsplothandlers@init@map@to@patched@versions + % +}% + +\def\pgfplots@xbar@width{pgfplotsxbarwidth} +\def\pgfplots@ybar@width{pgfplotsybarwidth} +\def\pgfplots@xbar@shift{pgfplotsxbarshift} +\def\pgfplots@ybar@shift{pgfplotsybarshift} +\def\pgfplots@bar@width@not@in@context{pgfplotsbarwidthgeneric} +\def\pgfplots@bar@shift@not@in@context{pgfplotsbarshiftgeneric} + +\pgfmathdeclarefunction{pgfplotsxbarwidth}{0}{\pgfplots@bar@mathparse@{y}{bar width}}% +\pgfmathdeclarefunction{pgfplotsybarwidth}{0}{\pgfplots@bar@mathparse@{x}{bar width}}% +\pgfmathdeclarefunction{pgfplotsxbarshift}{0}{\pgfplots@bar@mathparse@{y}{bar shift}}% +\pgfmathdeclarefunction{pgfplotsybarshift}{0}{\pgfplots@bar@mathparse@{x}{bar shift}}% +\pgfmathdeclarefunction{pgfplotsbarwidthgeneric}{0}{\pgfplots@bar@mathparse@{N}{bar width}}% +\pgfmathdeclarefunction{pgfplotsbarshiftgeneric}{0}{\pgfplots@bar@mathparse@{N}{bar shift}}% + +\def\pgfplots@bar@mathparse@#1#2{% + \pgfmathparse{\pgfkeysvalueof{/pgf/#2}}% + \ifpgfmathunitsdeclared + \else + \if N#1% + \pgfplots@bar@mathparse@error{#1}{#2}% + \else + \let\pgfplots@loc@TMPa=\pgfmathresult + \csname pgfplotstransformdirection#1\endcsname{\pgfplots@loc@TMPa}% + \let\pgfplots@loc@TMPa=\pgfmathresult + \if#1x% + \pgfqpointxy{\pgfplots@loc@TMPa}{0}% + \edef\pgfmathresult{\pgf@sys@tonumber\pgf@x}% + \else + \pgfqpointxy{0}{\pgfplots@loc@TMPa}% + \edef\pgfmathresult{\pgf@sys@tonumber\pgf@y}% + \fi + %\edef\pgfplots@loc@TMPa{{\pgf@sys@tonumber\pgf@x}{\pgf@sys@tonumber\pgf@y}}% + %\expandafter\pgfmathveclen@\pgfplots@loc@TMPa + \fi + \fi +}% + +\def\pgfplots@bar@mathparse@error#1#2{% + \pgfplots@error{Sorry, the value '#2=\pgfkeysvalueof{/pgf/#2}' is given in terms of a unit -- but I do not know which axis! Please set one of 'xbar' or 'ybar' before evaluating the value of '#2'}% }% % Resets the plot handler routines. @@ -425,6 +481,7 @@ \let\pgfplotsplothandlersurveydifflen=\pgfplotsplothandlersurveydifflen@default \let\pgfplotsplothandlersurveypointattime=\pgfplotsplothandlersurveypointattime@default \let\pgfplotsplothandlertransformslopedattime=\pgfplotsplothandlertransformslopedattime@default + \let\pgfplotsplothandlerifcurrentpointcanbefirstlast=\pgfplotsplothandlerifcurrentpointcanbefirstlast@default }% % \pgfplotsplothandlersurveystart @@ -435,6 +492,13 @@ [tikz@plot@handler: \meaning\pgf@plotstreamstart]% }% +% \pgfplotsplothandlerifcurrentpointcanbefirstlast : can be used to +% check if the current point of a plot handler can be the global first +% or last segment. +% It will execute #1 if that is the case and #2 if not. +\def\pgfplotsplothandlerifcurrentpointcanbefirstlast@default#1#2{#1}% + + % \pgfplotsplothandlersurveyend % Called at the end of each survey phase. \def\pgfplotsplothandlersurveyend@default{} @@ -1852,6 +1916,7 @@ contour external/scanline marks/required/.code={\def\pgfplotsplothandlercontourexternal@scanlinemode{2}}, contour external/scanline marks/true/.code={\def\pgfplotsplothandlercontourexternal@scanlinemode{2}}, contour external/scanline marks/if in input, + contour external/output point meta/.initial=, contour external/file/.initial=,% auto-generate contour external/script extension/.initial=script, contour external/script/.initial=,% not yet initialised @@ -2479,10 +2544,15 @@ \pgfplotsplothandlercontourprepared \let\pgfplots@coord@stream@start=\relax% has already been done. \def\pgfplots@coord@stream@end{\pgfplotsplothandlersurveyend}% - \ifpgfplots@curplot@threedim - \pgfplotssetpointmetainput{z}{}% + \pgfkeysgetvalue{/pgfplots/contour external/output point meta}\pgfplots@loc@TMPa + \ifx\pgfplots@loc@TMPa\pgfutil@empty + \ifpgfplots@curplot@threedim + \pgfplotssetpointmetainput{z}{}% + \else + \pgfplotssetpointmetainput{explicit}{}% + \fi \else - \pgfplotssetpointmetainput{explicit}{}% + \expandafter\pgfplots@pgfkeys@set@point@meta@value\expandafter{\pgfplots@loc@TMPa}% \fi \pgfplots@addplotimpl@file@streamit{\pgfplotsplothandlercontourexternal@file.table}% \closein\r@pgfplots@reada |