summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex55
1 files changed, 46 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
index 8ac9a7631c0..7e7e5232fc0 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
@@ -52,6 +52,12 @@
\advance\pgf@xa by-\the\c@pgf@countb pt
\ifdim\pgf@xa>0.5pt
\advance\c@pgf@countb by1
+ \ifnum\c@pgf@countb=60
+ \c@pgf@countb=#4 %
+ \advance\c@pgf@countb by1
+ \edef#4{\the\c@pgf@countb}%
+ \c@pgf@countb=0
+ \fi
\fi
\edef#5{\the\c@pgf@countb}%
}
@@ -94,8 +100,8 @@
\let\pgfplots@calender@ZEROSHIFT=\pgfmathresult
},
date ZERO=2006-01-01,
- /pgfplots/date coordinates in/.style={
- /pgfplots/#1 coord trafo/.code={%
+ /pgfplots/date coordinates in/.code={%
+ \pgfkeysdef{/pgfplots/#1 coord trafo}{%
\begingroup
\edef\pgfplotstempjuliandate{##1}%
% check if we also have a TIME like '2006-01-01 11:21'
@@ -126,8 +132,8 @@
\fi
\pgfmath@smuggleone\pgfmathresult
\endgroup
- },
- /pgfplots/#1 coord inv trafo/.code={%
+ }%
+ \pgfkeysdef{/pgfplots/#1 coord inv trafo}{%
\begingroup
\pgfplotslibdateplot@number@to@julian@and@time##1\julianto{\c@pgf@counta}\hourto\Hour\minuteto\Minute%
\advance\c@pgf@counta by\pgfplots@calender@ZEROSHIFT\relax
@@ -152,12 +158,43 @@
\def\Second{0}%
\def\second{00}%
\edef\lowlevel{##1}%
- \edef\pgfmathresult{\year-\month-\day}%
- },
- /pgfplots/#1ticklabel={\tick},%
- /pgfplots/scaled #1 ticks=false,
- /pgfplots/plot coordinates/math parser=false,%
+ \pgfkeysifdefined{/pgfplots/date default inv/#1}{%
+ \edef\pgfmathresult{\pgfkeysvalueof{/pgfplots/date default inv/#1}}%
+ }{%
+ \edef\pgfmathresult{\year-\month-\day\space\hour:\minute:\second}%
+ }%
+ }%
+ \pgfkeysifdefined{/pgfplots/#1ticklabel/.@cmd}{%
+ \pgfkeysalso{%
+ /pgfplots/#1ticklabel={\tick},%
+ /pgfplots/scaled #1 ticks=false,%
+ /pgfplots/plot coordinates/math parser=false,%
+ }%
+ }{%
+ % OK. The style can be used for other coordinates as well
+ % (like hist/data)
+ }%
+ %
+ \pgfkeysifdefined{/pgfplots/#1 is expr}{%
+ \pgfkeyssetvalue{/pgfplots/#1 is expr}{0}%
+ }{}%
+ %
+ % Allow a callback (optional)
+ \pgfkeysifdefined{/pgfplots/#1/@execute on coord trafo changed/.@cmd}{%
+ \pgfkeysalso {/pgfplots/#1/@execute on coord trafo changed}%
+ }{}%
},
/pgfplots/date coordinates in/.value required,
+ %
+ % #1: the argument for 'data coordinates in={#1}
+ % #2: the default for the inverse transformation. If there is
+ % none, a default will be chosen automatically (with full
+ % information)
+ /pgfplots/date coordinates default inverse/.style 2 args={%
+ /pgfplots/date default inv/#1/.initial=#2,
+ },
+ /pgfplots/date coordinates default inverse={x}{\year-\month-\day},
+ /pgfplots/date coordinates default inverse={y}{\year-\month-\day},
+ /pgfplots/date coordinates default inverse={z}{\year-\month-\day},
}