Example: Surface Plot

Published 2014-03-15 | Author: Christian Feuersänger

We have two functions for which we seek a plot: the first is a sampled function given by a huge data file and the second is the math expression g(x,y) = exp(-x^2 - y^2) * x.

Our first function actually consists of two data files: the first file contains some scattered data which is used to discretized (“sample”) a function and the second file contains data for the function as such. Our requirement here is two draw two graphs into the same axis: one in which the function is plotted as a smooth, colored surface and one in which the scattered data file should be on top of the surface because it provides more detail how the function was represented in the computer.

The second function which is given as math expression should be visualized using a contour plot.

The code is from the PGFPlots 1.10 manual: “3.5 Solving a Real Use-Case: Functions of Two Variables”.

Download as: [PDF] [TEX]  •  [Open in Overleaf]

Surface Plot

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de.

    colorbar horizontal,
    xlabel=$x$, ylabel=$y$,
\addplot3[surf,mesh/ordering=y varies,
    table {concat_VV_together.dat};


Adding comments is currently not enabled.