% fun_contour.m — Contour plot of a surfacefun. % % contour draws level sets of a scalar field on the surface. Contouring % is more expensive than a plain plot, so this script uses a coarse mesh % to stay quick; raise p / nref for smoother curves. mip load --install flatironinstitute/flatironinstitute/surfacefun p = 8; nref = 0; dom = surfacemesh.sphere(p + 1, nref); f = surfacefun(@(x, y, z) cos(6*x) .* y + exp(z), dom); figure(1); contour(f, linewidth=2) axis off title('Contours of f');