Example: Distraction-free plotting in three dimensions

Published 2015-09-24 | Authors:

We will use pgfplots for a three-dimensional plot of an exponential function.

We will apply a style for reduced and shifted axes, to get a distraction-free visualization.

If you don’t have it already, download the file http://pgfplots.net/media/tikzlibrarypgfplots.shift.code.tex, and put it into your document folder.

Load this style in your preamble by:


Now, we can use the shift style, as in this short example.

The code, and more, is explained in the LaTeX Cookbook, Chapter 10, Advanced Mathematics, Plotting in three dimensions.

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

Distraction-free plotting in three dimensions
% Distraction-free plotting in three dimensions
% Author: Stefan Kottwitz
% https://www.packtpub.com/hardware-and-creative/latex-cookbook
  \begin{axis} [shift3d]
    \addplot3 [surf, colormap/hot2, domain = -2:2, samples = 50]
      { x/exp(x^2+y^2) };


Adding comments is currently not enabled.

There are currently 0 comments on this entry.

Scientific and technical areas
LaTeX Cookbook


LaTeX Beginners Guide

Creative Commons License