3

For each point of the grid a have the coordinates (X,Y) and height (Z), like:

X
1 2 3
1 2 3
1 2 3

Y
1 1 1
2 2 2
3 3 3

Z
2 1 0
4 5 1
8 4 3
2

A possible solution with pgfplots:

\documentclass[png,tikz,border=10pt]{standalone}

\usepackage{pgfplots,filecontents}

\begin{filecontents}{data.dat}
X Y Z
1 1 2
2 1 1
3 1 0

1 2 4
2 2 5
3 2 1

1 3 8
2 3 4
3 3 3
\end{filecontents}

\begin{document}

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

The result:

enter image description here

| improve this answer | |
  • Thanks Claudio. With tikz I already have done. But I would like pstricks because I have others elements, that are in pstricks, to compose all the picture. – Alexandre Aug 21 '13 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.