# 3D plot from file [closed]

Hi I am currently learning how to do plots in Tex and I found a problem which I cant solve. I would like to do 3D surface plot from file but all what I get is a 3D line. For learning purpose I used an generic example from pgfplots documentation (function of {5*x*sin(2*deg(x)) * y};) and then tried to plot it from the file which contains data of this function.

\begin{figure}[!ht]

\begin{tikzpicture}
\begin{axis}[grid=major,
colormap/greenyellow]

table [x=x, y=y, z=z, col sep=tab]{3D.txt};
\end{axis}
\end{tikzpicture}


File 3D.txt contains:

z   x   y
0   0   0
0.001247918 0.05    0.05
0.009933467 0.1 0.1
0.033246023 0.15    0.15
0.077883668 0.2 0.2
0.149820481 0.25    0.25
0.254089113 0.3 0.3
0.394583333 0.35    0.35
0.573884873 0.4 0.4
0.793118496 0.45    0.45
1.051838731 0.5 0.5
1.347951132 0.55    0.55
1.677670355 0.6 0.6
2.035516667 0.65    0.65
2.414351838 0.7 0.7
2.80545465  0.75    0.75
3.19863553  0.8 0.8
3.582389128 0.85    0.85
3.944082905 0.9 0.9
4.270179146 0.95    0.95
4.546487134 1   1


Then what I get is on the figure 1

and it should be like this

• You only have z values for y=x, so there are not enough values to generate a surface. – erik Apr 6 '15 at 20:21