summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex52
1 files changed, 52 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
index 4076e37281c..f3e4674f9e6 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
@@ -1035,6 +1035,58 @@
\let\pgfplotspatchclass@rect@D@=\pgfplotspatchclass@rect@D%
}%
+
+% An arbitrary poligy specified in the sequence
+% D <-- C
+% | ^
+% v |
+% A --> B
+%
+\pgfkeyssetvalue{/pgfplots/vertex count}{0}%
+\pgfplotsdeclarepatchclass{polygon}{%
+ new=\def\pgfplotspatchclass@poly@no{0},
+ set next vertex={%
+ \pgfplotspatchclass@poly@checkcount
+ \expandafter\edef\csname pgfplotspatchclass@poly@\pgfplotspatchclass@poly@no\endcsname{#1}%
+ \pgfplotsutil@advancestringcounter\pgfplotspatchclass@poly@no
+ \ifnum\pgfplotspatchclass@poly@no=\pgfkeysvalueof{/pgfplots/vertex count} %
+ \def\pgfplotspatchclass@poly@no{0}%
+ \pgfplotspatchready%
+ \fi
+ },
+ first vertex=\expandafter\expandafter\expandafter\pgfplotspatchvertex\csname pgfplotspatchclass@poly@0\endcsname\endvertex,
+ foreach vertex={%
+ \pgfplotspatchclass@poly@foreach@loop{0}{#1}%
+ },
+ init pdf shading={%
+ \pgfplots@error{Sorry, patch type=polygon does not support shadings}%
+ },
+ serialize except vertices=\let\pgfplotsretval\pgfutil@empty,%
+ deserialize except vertices=,
+ get pdf shading type=4,
+ get num vertices=\pgfkeysvalueof{/pgfplots/vertex count},
+}%
+\def\pgfplotspatchclass@poly@checkcount{%
+ \ifnum\pgfkeysvalueof{/pgfplots/vertex count}>0
+ \else
+ \pgfplots@error{Sorry, 'patch type=polygon' *requires* that 'vertex count=<num>' is set (note: it is allowed if multiple vertices have the same coordinates).}%
+ \fi
+}%
+\long\def\pgfplotspatchclass@poly@foreach@loop#1#2{%
+ \ifnum#1<\pgfkeysvalueof{/pgfplots/vertex count} %
+ \expandafter\expandafter\expandafter\pgfplotspatchvertex\csname pgfplotspatchclass@poly@#1\endcsname\endvertex #2%
+ \begingroup
+ \c@pgf@counta=#1 %
+ \advance\c@pgf@counta by1 %
+ \t@pgfplots@toka={#2}%
+ \xdef\pgfplots@glob@TMPc{\noexpand\pgfplotspatchclass@poly@foreach@loop{\the\c@pgf@counta}{\the\t@pgfplots@toka}}%
+ \endgroup
+ \else
+ \gdef\pgfplots@glob@TMPc{}%
+ \fi
+ \pgfplots@glob@TMPc
+}%
+
\def\pgfplots@biquad@next@A{E}
\def\pgfplots@biquad@next@B{F}
\def\pgfplots@biquad@next@C{G}