2

I am trying to make a 3D surface in pgfplots with input data. I am not able to get the expected graph. I would highly appreciate if you could point out to me what I am missing.

\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{filecontents}


\begin{filecontents*}{mydata.dat}
x         y       z
 -1 -1  597.00
  1 -1  649.00
 -1 -1  597.00
  1 -1  649.00
 -1  1 1056.75
  1  1  801.50
 -1  1 1056.75
  1  1  801.50
 -1 -1  597.00
  1 -1  649.00
 -1 -1  597.00
  1 -1  649.00
 -1  1 1056.75
  1  1  801.50
 -1  1 1056.75
  1  1  801.50
\end{filecontents*}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[]
       \addplot3[surf,  mesh] table{mydata.dat};
    \end{axis}
\end{tikzpicture}

\end{document}
MYaseen208
  • 8,587
  • 2
    I'm not sure what the 'expected' graph is :) However, note that there are lots of repeated points- for example, -1 -1 597 is repeated 4 times; perhaps the x and y values should have changed? – cmhughes Jan 01 '13 at 21:13
  • Thanks @cmhughes for your comment. Is repeating value make any difference? Actually I want to make a surface plot. – MYaseen208 Jan 01 '13 at 21:37
  • 3
    Well, your code does produce a surface plot, it's just not the one you want :) Presumably you want more data points, such as (for example) -0.5 -0.5 300 etc. – cmhughes Jan 01 '13 at 21:39
  • Could you describe what kind of surface you expect? Also, how did you get the list of coordinates, is it the output of some other program? – Jake Jan 02 '13 at 14:43

0 Answers0