We will combine surface and contour plots. We would like the contour lines drawn on the surface to be hidden by the surface in the…

We will draw a regression line through some points, as in http://pgfplots.net/tikz/examples/regression-line/ . This time, we will implement a style for negative and positive residuals…

For displaying the total effect of a series of values, a waterfall chart can be useful. For example this chart, taken from “The Economist”, illustrates…

We would like to make an image to illustrate the construction of a spiral capacitor. These are made of spiral coiled films. It’s like a…

Using PGFPlotstable, we can use a naive numerical integration scheme to find the function directly within LaTeX. This code was written by Jake on TeX.SE.…

Here, the trick is to use stack plots=y together with closedcycle to create the error bands. We define a new command, \addplotwitherrorbands[<optional styles>]{<function>}{<positive error>} {<negative…

A Moebius strip plot. This code was written by Jake on TeX.SE. \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}[ hide axis, view = {40}{40} ] \addplot3…

We would like to draw a bivariate normal distribution and show where the means from the two variables meet in the space. There are a…

A Christmas tree plot. This code was written by Jake on TeX.SE. \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}[ hide axis, clip=false, y domain=0:2*pi, samples=30,axis equal,…