I'd like to create a contour plot of data stored in the file "test.dat". There should be one continously shaded contour plot and then I'd like to "highlight" some contour lines using contour gnuplot. The shaded plot without the extra contour lines works fine, however I get the following error when trying to add the contour gnuplot command:
*_contourtmp0.script" line 1: warning: Cannot contour non grid data. Please use "set dgrid3d".
The desired image should look something like this
The Latex code is the following:
\begin{tikzpicture}
\begin{axis}[
colorbar,
shader = interp,
mesh/ordering=x varies,
view={0}{90},
enlargelimits=false,
unbounded coords=jump,]
\pgfplotstableread[col sep = comma, header=true ]{test.dat}\plotTable
% surface plot
\addplot3[
mesh/cols=4,
surf, ]
table [ x index = 0,
y index = 1,
z index = 2,] from \plotTable {};
\addplot3[
mesh/cols=4,
contour gnuplot = {number = 4},]
table [ x index = 0,
y index = 1,
z index = 2,] from \plotTable {};
\end{axis}
\end{tikzpicture}
Data file test.dat:
x, y, z,
1, 0, 3,
2, 0, 6,
3, 0, 9,
4, 0, 12,
1, 1, 3,
2, 1, 6,
3, 1, 9,
4, 1, 12,
1, 2, 3,
2, 2, 6,
3, 2, 9,
4, 2, 12,
1, 3, 3,
2, 3, 6,
3, 3, 9,
4, 3, 12,
1, 4, 3,
2, 4, 6,
3, 4, 1,
4, 4, 12,
1, 5, 3,
2, 5, 6,
3, 5, 9,
4, 5, 12,
1, 6, 3,
2, 6, 6,
3, 6, 9,
4, 6, 12,
1, 7, 3,
2, 7, 6,
3, 7, 9,
4, 7, 12,
1, 8, 3,
2, 8, 6,
3, 8, 9,
4, 8, 12,
1, 9, 3,
2, 9, 6,
3, 9, nan,
4, 9, nan,

