Graphics, Figures & TablesSurface plots

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
niles
Posts: 92
Joined: Mon Dec 01, 2008 9:35 pm

Surface plots

Post by niles »

Hi

I have a surface plot similar to the one in the lower part found here: http://www.mathworks.se/help/techdoc/ref/surf.html

Is a way to take the data points and make a similar plot in either TikZ or PSTricks? If not, then what is the "standard" way to take such a plot and write the labels in TeX?

I hope my question is clear.

Best,
Niles.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Surface plots

Post by Stefan Kottwitz »

Hi Niles,

tikz-3dplot is capable of generating surface plots. Perhaps have a look at Jeff's article: Drawing with the tikz-3dplot Package.

Stefan
LaTeX.org admin
niles
Posts: 92
Joined: Mon Dec 01, 2008 9:35 pm

Re: Surface plots

Post by niles »

Hi Stefan

Thanks for the quick reply, I'll check it out.

Best,
Niles.
feuersaenger
Posts: 34
Joined: Sun Oct 16, 2011 5:56 pm

Surface plots

Post by feuersaenger »

Hi Niles,

you can also use pgfplots for surface plots. It features automatically scaled axes, automatically generated tick labels, axis descriptions, automatic color mapping, four coordinates for X,Y,Z, and cdata (as in matlab), flat shadin\thispagestyle{empty}g, interpolated shading and faceted shading (as in matlab), and a powerful and flexible coordinate input mechanism which supports both data files, plotting expressions, and mixtures of both.

Here is a brief example:
P.png
P.png (113.92 KiB) Viewed 5790 times

Code: Select all

\documentclass{article}
\usepackage{tikz,pgfplots}

% this here is, in general, good practice - use the most recent
% pgfplots stable here:
\pgfplotsset{compat=1.5}

\begin{document}

\begin{tikzpicture}
\begin{axis}
	\addplot3[surf] {x*y};
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}
	\addplot3[surf,shader=interp] {x*y};
\end{axis}
\end{tikzpicture}
\end{document}
Post Reply