summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex38
1 files changed, 36 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
index 2d0ec9c1911..1c074e70bf7 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
@@ -1055,6 +1055,40 @@
\pgfplotstable@copy@globalbuffers@to#3
}%
+% \pgfplotstablevertcat{<table1>}{<table2>}
+% appends the contents of <table2> to <table1>. To be more precise,
+% only columns which exist already in <table1> will be used.
+%
+% If <table1> is undefined, <table2> will be copied completely to
+% <table1>.
+%
+% #1 a table macro.
+% #2 either a file name or a table macro.
+\def\pgfplotstablevertcat#1#2{%
+ \pgfplotstable@isloadedtable{#2}{%
+ \pgfplotstable@isloadedtable{#1}{%
+ % for each column in '#1':
+ \pgfplotslistforeachungrouped#1\as\pgfplotstable@loc@TMPa{%
+ % for each row in the corresponding column of '#2':
+ \expandafter\pgfplotstablegetcolumnbyname\expandafter{\pgfplotstable@loc@TMPa}\of{#2}\to\pgfplotstable@loc@TMPb
+ \pgfplotslistforeachungrouped\pgfplotstable@loc@TMPb\as\pgfplotstable@loc@TMPc{%
+ \t@pgfplots@toka=\expandafter{\pgfplotstable@loc@TMPc}%
+ \edef\pgfplotstable@loc@TMPd{%
+ \noexpand\pgfplotslistpushback{\the\t@pgfplots@toka}\to\expandafter\noexpand\csname\string#1@\pgfplotstable@loc@TMPa\endcsname
+ }%
+ \pgfplotstable@loc@TMPd
+ }%
+ }%
+ }{%
+ \pgfplotstablecopy{#2}\to{#1}%
+ }%
+ }{%
+ % FIXME : restore memory here !? SCOPING BUG
+ \pgfplotstableread{#2}\pgfplotstable@tmptbl
+ \pgfplotstablevertcat{#1}{\pgfplotstable@tmptbl}%
+ }%
+}
+
\def\pgfplotstablegetcolumnlist#1\to#2{\let#2=#1}
% Returns a column vector in form of \pgfplotslist
@@ -1172,8 +1206,8 @@
\def\pgfplotstablecopy#1\to#2{%
\let#2=#1%
- \pgfplotstablegetname#2\pgfplotstable@loc@TMPa
- \expandafter\let\csname\string#1@@table@name\endcsname=\pgfplotstable@loc@TMPa
+ \pgfplotstablegetname#1\pgfplotstable@loc@TMPa
+ \expandafter\let\csname\string#2@@table@name\endcsname=\pgfplotstable@loc@TMPa
\pgfplotslistforeachungrouped#1\as\pgfplotstable@loc@TMPa{%
\def\pgfplotstable@loc@TMPb{%
\expandafter\let\csname\string#2@\pgfplotstable@loc@TMPa\endcsname}%