Partial solution
I've downloaded and unzipped your ZIP file. In that folder I created a standalone Lua script (mal-preprocess.lua
) which processes those three data sets.
The output is one file suitable for PSTricks (toimage-pst.data
) and one file (toimage.data
) for PGFplots. I don't know how to set the graph properly in PSTricks and I'm reaching limits in PGFplots/pdflatex, therefore an enclosed example is limited from #tensions
(number of lines; line 33 in the Lua code) to the first 200
entries.
I run in that folder:
texlua mal-preprocess.lua
These are skeletons of the TeX files, we run:
latex mal-contour.tex
dvips mal-contour.dvi
ps2pdf mal-contour.ps
and
lualatex mal-contour-pgfplots.tex
I enclose the Lua code, those two TeX files and a preview of the snippet from PGFplots (I'm having some difficulties with ps2pdf
). The mal-preprocess.lua
file is:
-- I am mal-preprocess.lua...
-- I take 3 data sets and prepare data set for PSTricks...
--local pstricks=0 -- 0 (pgfplots) or 1 (pstricks)
local c=0 -- a counter of data
-- Cashing files...
print("Cashing 3 files...")
time="time.csv" -- 175
speed="speed.csv"
tension="tension.csv"
local times={}
for time in io.lines(time) do
table.insert(times,time)
end -- for time
local speeds={}
for speed in io.lines(speed) do
table.insert(speeds,speed)
end -- for speed
local tensions={}
for tension in io.lines(tension) do
table.insert(tensions,tension)
end -- for tension
-- The core...
whereto=io.open("../toimage.data","w")
topst=io.open("../toimage-pst.data","w")
topst:write("/contourdata [")
print("Processing "..#tensions.." lines...")
-- Load all lines...
--local temp=""
for tension=1,200 do -- #tensions or 300
c=0
topst:write("[\n")
-- Parse that one line...
for mdata in string.gmatch(tensions[tension],"[^,]+") do
c=c+1
writeme=speeds[tension].." "..times[c].." "..mdata.."\n"
whereto:write(writeme)
topst:write(writeme)
end -- for mdata
topst:write("]")
whereto:write("\n")
end -- for tension
topst:write("] def\n")
This is the mal-contour.tex
file:
% run: latex mal-contour.tex
% -> ps; ->pdf
\documentclass{article}
\usepackage{pstricks-add}
\begin{document}
\psset{unit=0.1cm}
\begin{pspicture}[showgrid](0,1)(4775,3.5)
\pstContour[colored]{toimage-pst.data}
\end{pspicture}
\end{document}
The second file is the mal-contour-pgfplots.tex
file:
% run: lualatex engine mal-contour-pgfplots.tex
\documentclass[a4paper]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\begin{document}
\begin{tikzpicture}
\begin{axis}[view={0}{90},colorbar,grid=none]
\addplot3[surf,shader=interp,mesh/cols=175] file {toimage.data};
\end{axis}
\end{tikzpicture}
\end{document}

I believe that GNUplot is a better tool for manipulating huge data sets. I would recommend to use PNG file at the TeX level instead of a vector form as there are so many elements in it. This is a fast test (mal-test.plt
) for GNUplot, I enclose the code and a preview of mal-test.png
which can be loaded by the \includegraphics
command from the graphicx
package.
set terminal png
set output "mal-test.png"
unset key
set title ""
set xlabel ""
set ylabel ""
set xrange [ 0.0000 : 84.30000 ] noreverse nowriteback
set yrange [ 1.0000 : 3.50000 ] noreverse nowriteback
set zrange [ -100.0000 : -85.00000 ] noreverse nowriteback
splot "toimage.data"

Update: A note on the data transformation
You can picture your three files as here (one file consists the first row, the second file consists the first column and the last file consists the cells/data set):
- A B C D
X 1 2 3 4
Y 5 6 7 8
Z 9 0 1 2
We transform them to this form by repeating the labels from the first row and from the first column (however, the file size of data changed significantly from 96200+12390248+1199=12487647 to 48643360 bytes - toimage.data - that's the reason we usually don't save data in this form):
X A 1
X B 2
X C 3
X D 4
Y A 5
Y B 6
Y C 7
Y D 8
Z A 9
Z B 0
Z C 1
Z D 2
time
andvelocity
), and associate to each rectangle a color, in function of thetension
... I can provide you ameshgrid
file (the matrix product between time and velocity), if you'd like to... But don't spend ages on that, we're not about to create a new pst-package for it ;)