summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex66
1 files changed, 45 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
index 0c1f8dc41fe..0ef2cb01c8d 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
@@ -83,16 +83,16 @@
% #1: the required LaTeX package
% #2: the feature which requires this package
\def\pgfplots@assert@LaTeX@package@loaded#1#2{%
- \pgfutil@ifundefined{@ifpackageloaded}{%
+ \pgfutil@IfUndefined{@ifpackageloaded}{%
\pgfplots@error{Sorry, #2 only works with LaTeX (it relies on the LaTeX package #1)}%
}{%
- \pgfutil@ifundefined{ver@#1.sty}% this here has been extracted from ltclass.dtx. \@ifpackageloaded is only usable in preamble.
+ \pgfutil@IfUndefined{ver@#1.sty}% this here has been extracted from ltclass.dtx. \@ifpackageloaded is only usable in preamble.
{\pgfplots@error{Sorry, use need \string\usepackage{#1} in your preamble for '#2'}}%
{\relax}%
}%
}%
\def\pgfplots@assert@tikzinternal@exists#1{%
- \pgfutil@ifundefined{#1}{%
+ \pgfutil@IfUndefined{#1}{%
\pgfplots@error{Sorry, pgfplots relies on the existance of the tikz internal macro '#1'.
Unfortunately, this does no longer exist ... you will need to get an updated version of pgfplots to fix this problem.}%
\expandafter\let\csname #1\endcsname=\pgfutil@empty
@@ -119,7 +119,7 @@
% #2: a macro name WITHOUT backslash.
% #3: the default value if everything fails.
\def\pgfplots@gettikzinternal@keyval#1#2#3{%
- \pgfutil@ifundefined{#2}{%
+ \pgfutil@IfUndefined{#2}{%
\pgfkeysifdefined{/tikz/#1}{%
\pgfkeysgetvalue{/tikz/#1}\pgfplots@TMP
\expandafter\let\csname #1\endcsname=\pgfplots@TMP
@@ -138,7 +138,7 @@
}%
\def\pgfplots@getcurrent@plothandler#1{%
- \pgfutil@ifundefined{tikz@plot@handler}{%
+ \pgfutil@IfUndefined{tikz@plot@handler}{%
\pgfplots@error{Sorry, can't get the current plot handler. It appears that tikz and pgfplots is no longer compatible!? You will need to get a newer version of pgfplots.}%
\let#1=\pgfplothandlerlineto
}{%
@@ -212,7 +212,7 @@
}%
\pgfplots@command@to@string\pgfplotsutil@@arg@ifdefined\pgfplotsutil@@arg@ifdefined
\expandafter\pgfplotsutil@trim\expandafter{\pgfplotsutil@@arg@ifdefined}%
- \pgfutil@ifundefined{\pgfplotsretval}{#3}{#2}%
+ \pgfutil@IfUndefined{\pgfplotsretval}{#3}{#2}%
}%
% The same as \pgfplotsutil@ifdefinedui but appends the suffix '#2' to
% '#1' after '#1' has been normalized.
@@ -223,7 +223,7 @@
}%
\pgfplots@command@to@string\pgfplotsutil@@arg@ifdefined\pgfplotsutil@@arg@ifdefined
\expandafter\pgfplotsutil@trim\expandafter{\pgfplotsutil@@arg@ifdefined}%
- \pgfutil@ifundefined{\pgfplotsretval #2}{#4}{#3}%
+ \pgfutil@IfUndefined{\pgfplotsretval #2}{#4}{#3}%
}%
% Writes the command name of '#1' without the leading backslash to
@@ -804,6 +804,18 @@
%
\edef\pgfplots@loc@TMPb{#4}%
\expandafter\pgfplotsforeachlogarithmicungrouped@readdomain\pgfplots@loc@TMPb\relax
+ \pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{if is bounded}{\pgfplots@foreach@loc@TMPb}{%
+ }{%
+ \pgfplotsforeachlogarithmicmath@unbounded@domain{#4}%
+ \pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{parsenumber}{-10000}%
+ \let\pgfplots@foreach@loc@TMPb=\pgfmathresult
+ }%
+ \pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{if is bounded}{\pgfplots@foreach@loc@TMPa}{%
+ }{%
+ \pgfplotsforeachlogarithmicmath@unbounded@domain{#4}%
+ \pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{parsenumber}{-10000}%
+ \let\pgfplots@foreach@loc@TMPa=\pgfmathresult
+ }%
% compute mesh width into \pgfplots@foreach@loc@TMPc:
% \pgfplots@foreach@loc@TMPc := h := ( log(xmax) - log(xmin) ) / (N-1)
\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{op}{subtract}{{\pgfplots@foreach@loc@TMPb}{\pgfplots@foreach@loc@TMPa}}%
@@ -841,6 +853,11 @@
% restore scoped variables:
\pgfplots@foreach@loc@TMPd
}
+
+\def\pgfplotsforeachlogarithmicmath@unbounded@domain#1{%
+ \pgfplots@error{Sorry, the provided domain #1 is unsuitable for logarithmic sampling (applying the log results in unbounded values)}%
+}%
+
% can be used to convert the number format from float to something
% else.
\def\pgfplotsforeachlogarithmicungrouped@finalizeresult{}%
@@ -930,7 +947,7 @@
}
\def\pgfplots@logfileopen#1{%
\immediate\write-1{PGFPlots: reading {#1}}%
- \pgfutil@ifundefined{tikzifexternalizingcurrent}{%
+ \pgfutil@IfUndefined{tikzifexternalizingcurrent}{%
% version not up-to-date or external lib not loaded?
}{%
% adjust the .dep file only if we are externalizing.
@@ -1162,7 +1179,7 @@
-\pgfutil@ifundefined{pgfmathdeclarefunction}{%
+\pgfutil@IfUndefined{pgfmathdeclarefunction}{%
% BACKWARDS COMPATIBILITY: We have PGF 2.00 :
\def\pgfplotsmathdeclarepseudoconstant#1#2{%
\t@pgfplots@toka=\expandafter{\csname pgfmath#1@\endcsname}%
@@ -1459,12 +1476,12 @@
% defines \pgfplotsretval to be
%
-% \tikzifinpicture{#1}{#2}
+% \ifpgfpicture #1\else #2\fi
%
% and handles the '/pgfplots/invoke before crossref tikzpicture' key.
%
-% #1 first argument to \tikzifinpicture
-% #2 second argument to \tikzifinpicture
+% #1 first argument to \ifpgfpicture
+% #2 second argument to \ifpgfpicture
\def\pgfplots@assemble@ref@picture#1#2{%
\begingroup
\pgfkeysgetvalue{/pgfplots/invoke before crossref tikzpicture}\pgfplots@loc@TMPa
@@ -1474,13 +1491,13 @@
\toks2={#2}%
\toks3=\expandafter{\pgfplots@loc@TMPb}%
\xdef\pgfplots@glob@TMPa{%
- \noexpand\tikzifinpicture
- {\the\toks0}%
- {%
- \the\toks1
- \the\toks2
- \the\toks3
- }%
+ \noexpand\ifpgfpicture
+ \the\toks0 %
+ \noexpand\else
+ \the\toks1
+ \the\toks2
+ \the\toks3
+ \noexpand\fi
}%
\endgroup
\let\pgfplotsretval=\pgfplots@glob@TMPa
@@ -1491,7 +1508,7 @@
\immediate\write\@auxout{#1}%
\fi
}%
-\pgfutil@ifundefined{if@filesw}{%
+\pgfutil@IfUndefined{if@filesw}{%
\def\pgfplots@auxwrite#1{}%
}{%
\let\pgfplots@auxwrite=\pgfplots@auxwrite@latex
@@ -1958,10 +1975,17 @@
\gdef\pgfplotsHASH{#}%
\catcode`\%=12 \gdef\pgfplotsPERCENT{%}}
-\pgfutil@ifundefined{directlua}{}{%
+\pgfutil@IfUndefined{directlua}{}{%
\directlua{require(\pgfplotsDQ pgfplots.lua\pgfplotsDQ)}%
}%
+% swaps the content of two macros
+\def\pgfplotsutil@swap#1#2{%
+ \let\pgfplotsutil@swap@=#1%
+ \let#1=#2%
+ \let#2=\pgfplotsutil@swap@
+}%
+
\input pgfplotsliststructure.code.tex
\input pgfplotsliststructureext.code.tex
\input pgfplotsarray.code.tex