[Tex/LaTex] Surface plot with coordinates in pgf

3ddiagramspgfplotstikz-pgf

Is it possible to draw a three dimensional surface using coordinates instead of formulas?

MWE so far:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

 \begin{tikzpicture}
  \begin{axis} 
   \addplot3 coordinates
    {(23, 75, 13000) (23, 80, 14000) (23, 85, 15000) (23, 90, 16000) (23, 95, 17000) (28, 65, 7000) (28, 70, 8000) (28, 75, 9000) (28, 80, 10000) (28, 85, 11000) (28, 90, 12000) (28, 95, 13000)};
  \end{axis}
 \end{tikzpicture}

\end{document}

Best Answer

Yes this is possible. According to the manual you need to read in a datafile with a blank line between y values. Even though you asked for coordinates, I guess it is not really handy to type them in code if you can read a file instead,

0 0 0
1 0 1
2 0 1.5

0 1 0.5
1 1 2
2 1 0.7

Then you can read in this file

\documentclass{article}

\usepackage{pgfplots}

\begin{document}
 \begin{tikzpicture}
  \begin{axis}
   \addplot3[surf] file {test.dat};
  \end{axis}
 \end{tikzpicture}

\end{document}

enter image description here