Foundations — 3D plots — surface, wireframe
Before you can read a single line of the parent note, you need to earn every symbol it uses. This page defines each one from absolute zero: plain words → the picture → why the topic needs it. We build them in dependency order, so nothing appears before it is explained.
1. The pair — a point on the floor
Picture a tiled floor seen from above. Pick a corner as the origin (the spot ). Any tile is reached by walking tiles right and tiles up. That address is the pair .

Why the topic needs it: a surface is a rule that assigns a height to every floor spot. To talk about "every floor spot" you first need a way to name a floor spot — that is exactly .
2. The symbol — the height rule
- The letters are the two inputs (floor position).
- The letter is the one output (how high above that floor spot).
- is just a name for the rule — like or .

Why the topic needs it: the entire plot is the graph of . No function, no surface. Every example in the parent (X**2 + Y**2, sin(sqrt(...))) is just a choice of .
3. The 1D array
- The little number (the subscript) is the position, not multiplication.
- is the first entry, the second, and the last (because counting starts at ).
Why the topic needs it: the floor is continuous — infinitely many spots. A computer can only handle finitely many. So we choose a ladder of sample x-values and a ladder of sample y-values. Those two ladders are our 1D arrays.
4. The 2D array and the subscript — a table of numbers
Picture a spreadsheet: tells you which row (which floor-up level), tells you which column (which floor-across position).

Why the topic needs it: the floor is 2D, so the height table is 2D. Every one of X, Y, Z in the parent note is a 2D array of the same shape. Understanding "row , column " is the whole game.
5. Turning two ladders into a grid — what meshgrid builds
np.meshgrid(x, y) returns two 2D arrays, both of shape :
X— the x-coordinate at each grid cell. Constant across a row, changing along it.Y— the y-coordinate at each grid cell. Constant down a column, changing down it.
What just happened / why / what it looks like: we stamped the little x-ladder down every row of X, and stamped the y-ladder across every column of Y. Now cell holds the full floor address . The picture is a lattice of dots on the floor, each dot knowing both its coordinates.

Why the topic needs it: to compute the height at every combination of x and y without a Python loop, we need both coordinates as full 2D tables. Then a single elementwise formula does all evaluations at once.
6. Elementwise arithmetic —
X**2squares every entry (**is power in Python, not a footnote).sqrt,sinalso act cell by cell.
Why the topic needs it: this is the step "compute the pole heights". Because X and Y already carry the coordinates, one line Z = np.sin(np.sqrt(X**2 + Y**2)) fills the entire height table. (See NumPy vectorization for why this is fast, and meshgrid and broadcasting for how shapes line up.)
7. Draping the sheet — plot_surface / plot_wireframe
ax.plot_surface(X, Y, Z)— stretches a filled colored sheet over the pole tops.ax.plot_wireframe(X, Y, Z)— connects the pole tops with lines only (a see-through net).
Order of arguments is always (X, Y, Z) = floor-across, floor-up, sky. See Matplotlib figure and axes objects for what fig and ax are.
8. Colormaps and strides (the finishing knobs)
Viewed from straight above, the same grid becomes a contour plot — same data, different camera.
Prerequisite map
Equipment checklist
Test yourself — reveal only after answering:
What does the pair name?
Why does a height need a third letter ?
In , what is ?
What does np.linspace(-3, 3, 60) produce?
In an array, what does the subscript in mean?
What is the shape of a 2D array with rows and columns?
What two arrays does np.meshgrid(x, y) return and their shape?
X and Y, each of shape (len(y), len(x)), holding the x- and y-coordinate at every grid cell.What does elementwise Z = X**2 + Y do?
How do you make an axes that can host plot_surface?
ax = fig.add_subplot(projection='3d').Which of surface/wireframe supports a colormap and why?
What do rstride/cstride do?
Connections
- Parent: 3D plots — surface & wireframe
- meshgrid and broadcasting
- 2D plots — line, scatter
- Matplotlib figure and axes objects
- Contour plots
- NumPy vectorization
- Colormaps in Matplotlib