diff options
author | Karl Berry <karl@freefriends.org> | 2011-08-01 00:47:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-08-01 00:47:16 +0000 |
commit | aec2bbc3994991ebc6c5f4dbc90ad15c55f1a1fb (patch) | |
tree | 8940f33f6b173fb5cc630cc58ed4b791ad29e3fe /Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex | |
parent | 868233e6288b5e35a7d7aabd79bf8e56a802bc12 (diff) |
pgfplots 1.5 (29jul11)
git-svn-id: svn://tug.org/texlive/trunk@23292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex | 99 |
1 files changed, 47 insertions, 52 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex index 3c3e9dd7f6a..2276f571db9 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex @@ -46,32 +46,29 @@ % 2. At the beginning and end of each plot, the lists in 1.) are % initialised properly. % -% 3. While plot coordinates are processed, the following methods +% 3.1 While plot coordinates are processed during the survey phase, the following methods % interact with the stacked API: % \pgfplots@stacked@preparepoint@inmacro % -> compute the 'stacked' sum. % This may need to be done with floating point arithmetics because % the data scaling trafo is not yet initialised +% \pgfplots@stacked@rememberzerolevelpoint@for@next@plot +% \pgfplots@stacked@getnextzerolevelpoint % +% +% 3.2 during the final visualization phase, we have % \pgfplots@stacked@finishpoint % -> takes coordinates as they will be given to Tikz. This method is % used to % - communicate zero level coordinates to Tikz % - implement the 'closed paths' option (allows filled stacked plots). % -% \pgfplots@stacked@rememberzerolevelpoint@for@next@plot -% \pgfplots@stacked@getnextzerolevelpoint -% % 4. Zero levels are communicated to Tikz by % \pgfplots@stacked@initzerolevelhandler. This routine initialises an % input stream for Tikz plot handlers which produces a sequence of % zero levels. It is used by [xy]comb and [xy]bar. % % -% REMARK: -% the state of the boolean \ifpgfplots@datascaletrafo@initialised -% determines whether these routines expect and return floating point -% numbers or fixed point numbers. \let\pgfplots@stacked@zerolevelpoint@x=\pgfutil@empty \let\pgfplots@stacked@zerolevelpoint@y=\pgfutil@empty @@ -114,29 +111,25 @@ \let\pgfplots@stacked@closedcycle@impl=\pgfutil@empty \ifpgfplots@stacked@isfirstplot \global\pgfplotslistnewempty\pgfplots@stacked@zerolevellist - \def\pgfplots@stacked@zerolevelpoint@x{0}% - \def\pgfplots@stacked@zerolevelpoint@y{0}% - \def\pgfplots@stacked@zerolevelpoint@z{0}% % only work with float if its really necessary - for % example if the scaling trafo which maps to pgfmath is % not yet initialised. - \ifpgfplots@datascaletrafo@initialised + \ifpgfplots@datascaletrafo@initialised % FIXME : should be '!ifsurvey' + \def\pgfplots@stacked@zerolevelpoint@x{0}% + \def\pgfplots@stacked@zerolevelpoint@y{0}% + \def\pgfplots@stacked@zerolevelpoint@z{0}% \else - \ifpgfplots@xislinear - \pgfmathfloatcreate{0}{0.0}{0}% - \let\pgfplots@stacked@zerolevelpoint@x=\pgfmathresult - \fi - \ifpgfplots@yislinear - \pgfmathfloatcreate{0}{0.0}{0}% - \let\pgfplots@stacked@zerolevelpoint@y=\pgfmathresult - \fi - \ifpgfplots@threedim - \ifpgfplots@zislinear - \pgfmathfloatcreate{0}{0.0}{0}% - \let\pgfplots@stacked@zerolevelpoint@z=\pgfmathresult - \fi - \fi + \pgfplotscoordmath{x}{parsenumber}{0}% + \let\pgfplots@stacked@zerolevelpoint@x=\pgfmathresult + \let\pgfplots@stacked@zerolevelpoint@y=\pgfmathresult + \let\pgfplots@stacked@zerolevelpoint@z=\pgfmathresult + % + \pgfmathfloatcreate{0}{0.0}{0}% + \ifpgfplots@xislinear\else \let\pgfplots@stacked@zerolevelpoint@x=\pgfmathresult \fi + \ifpgfplots@yislinear\else \let\pgfplots@stacked@zerolevelpoint@y=\pgfmathresult \fi + \ifpgfplots@zislinear\else \let\pgfplots@stacked@zerolevelpoint@z=\pgfmathresult \fi \fi + % \def\pgfplots@stacked@getnextzerolevelpoint{}% will remain constant anyway. \else {\globaldefs=1 @@ -259,26 +252,27 @@ % - \pgfplots@current@point@[xyz] are adjusted. \def\pgfplots@stacked@preparepoint@inmacro{% \pgfplots@stacked@getnextzerolevelpoint + % \ifpgfplots@stacked@plus - \let\pgfplots@stacked@op=\pgfmath@basic@add@ + \def\pgfplots@stacked@op{add}% \else - \let\pgfplots@stacked@op=\pgfmath@basic@subtract@ + \def\pgfplots@stacked@op{subtract}% \fi \pgfplots@if{pgfplots@\pgfplots@stacked@dir islinear}{% - \ifpgfplots@datascaletrafo@initialised - \else - \ifpgfplots@stacked@plus - \let\pgfplots@stacked@op=\pgfmathfloatadd@ - \else - \let\pgfplots@stacked@op=\pgfmathfloatsubtract@ - \fi - \fi - }{}% - \edef\pgfplots@loc@TMPa{ - \noexpand\pgfplots@stacked@op - {\csname pgfplots@stacked@zerolevelpoint@\pgfplots@stacked@dir\endcsname}% - {\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}}% - \pgfplots@loc@TMPa + \pgfplotscoordmath{\pgfplots@stacked@dir}{op}{\pgfplots@stacked@op}{% + {\csname pgfplots@stacked@zerolevelpoint@\pgfplots@stacked@dir\endcsname}% + {\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}}% + }{% + % LOG. we need to compute log(zerolevel + current): + \pgfplotscoordmath{\pgfplots@stacked@dir}{exp}{\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}% + \pgfmathfloatparsenumber\pgfmathresult + \expandafter\let\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname=\pgfmathresult + \csname pgfmathfloat\pgfplots@stacked@op @\endcsname + {\csname pgfplots@stacked@zerolevelpoint@\pgfplots@stacked@dir\endcsname}% + {\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}% + }% + % + % for logs, I remember just zerolevel+current; not its log. \expandafter\let\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname=\pgfmathresult \ifpgfplots@threedim \ifpgfplots@curplot@threedim @@ -289,6 +283,12 @@ \else \pgfplots@stacked@rememberzerolevelpoint@for@next@plot{(\pgfplots@current@point@x,\pgfplots@current@point@y)}% \fi + % + \pgfplots@if{pgfplots@\pgfplots@stacked@dir islinear}{% + }{% + \pgfplotscoordmath{\pgfplots@stacked@dir}{log}{\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}% + \expandafter\let\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname=\pgfmathresult + }% } % This here is a re-implementation of the stored plot processing. @@ -469,16 +469,11 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endgroup % - \ifpgfplots@apply@datatrafo - \def\pgfplots@coord@stream@coord@{% - \pgfplots@apply@data@scaletrafo@to@one@point% - \pgfplots@coord@stream@finalize@currentpt - }% - \else - \def\pgfplots@coord@stream@coord@{% - \pgfplots@coord@stream@finalize@currentpt - }% - \fi + \def\pgfplots@coord@stream@coord@{% + \pgfplotsaxisvisphasetransformcoordinate\pgfplots@current@point@x\pgfplots@current@point@y\pgfplots@current@point@z% + \pgfplotsaxisvisphasepreparedatapoint + \pgfplots@coord@stream@finalize@currentpt + }% } % This command gets called after the sequence reversal has been done. |