The target is a correlated Gaussian in two dimensions, drawn as its one- and two-standard-deviation ellipses. Metropolis proposes a step from an isotropic Gaussian of size ρ and accepts it with probability min(1, p(z*)/p(z)) (green moves are accepted, red ones rejected). Gibbs sampling redraws one coordinate at a time from its conditional distribution. Both chains explore by a random walk, so when the target is elongated the number of steps per independent sample grows like (σmax/σmin)2.
Target: mean (1.5, 1.5), both marginal standard deviations s = 0.529, correlation r, so σmax = s√(1+r) and σmin = s√(1−r). With r = 0.759 this is the target of Figure 11.9, whose drawn ellipse is the two-standard-deviation contour (see the notes). The chain starts at (1, 1) for Metropolis and at (0.8, 0.8) for Gibbs; the random numbers are seeded, so a class sees the same pictures.
code/ch11_sampling.py (functions metropolis, gibbs_gaussian, overrelaxed_gibbs, ordered_overrelaxed_gibbs; Figures 11.9 to 11.12) and the checks in code/checks_ch11.py. Passing JSRandom(seed) to those functions reproduces this page's chains number for number.