Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
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 1 at 21:13
Thanks @cmhughes for your comment. Is repeating value make any difference? Actually I want to make a surface plot. – MYaseen208 Jan 1 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 1 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 2 at 14:43

closed as too localized by Joseph Wright Jan 11 at 17:20

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.