Before you can read the parent note Matplotlib and Seaborn visualization, you must own every word it throws at you without warning. This page builds each one from nothing — plain words first, then a picture, then why the topic needs it. Read top to bottom; each idea is a brick for the next.
Before the coordinate plane, meet one lonely number that shows up in every wave and circle.
The picture: a circle whose curved edge is unrolled into a straight strip; the strip is about 3.14 diameters long — that length ratio isπ.
Why the topic needs it: the parent writes np.linspace(0, 2*np.pi, 100) everywhere. If π is a mystery symbol, that line is a mystery. Now it's just "sweep from 0 to about 6.28."
Everything starts with a flat sheet and two number lines.
Look at the red dot in the figure. To find where it sits, we read its shadow onto each axis: it is 3 to the right and 2 up, so we call it (3,2). The pair of numbers is the position.
The picture: two rulers glued at a corner (the origin), a dot floating above them, with the +/− directions marked on each axis.
Why the topic needs it: every single thing a plot draws — a line, a bar, a scatter dot — is ultimately one or more points (x,y). If you don't own "point = pair of numbers = place on the sheet," nothing else lands.
The parent note writes y = np.sin(x) and expects a smooth wave. Let's earn that.
If we feed the rule many inputs x in a row and plot each resulting point (x,y), the dots line up into a curve.
In the figure, the red curve is y=sin(x). Each point on it obeys the rule: pick any x on the bottom, go up to the curve, and the height is sin(x). A curve is nothing more than "all the points a rule produces, drawn at once."
The picture: a wave, with a couple of sample points marked to show they came from the rule.
Why the topic needs it: line plots (ax.plot) draw curves. The parent note plots sine waves and loss curves — both are "many points from a rule, connected."
We don't derive these here; you only need to know what shape each makes so a plotted curve isn't a mystery.
The parent writes np.linspace(0, 2*np.pi, 100) and np.arange(1, 51). These make arrays.
To plot a curve you need two arrays of equal length: one of x values, one of matching y values. Matplotlib pairs them up position-by-position: the 1st x with the 1st y, and so on.
The picture: two vertical stacks of numbers, arrows pairing stack-A's row with stack-B's row.
Why the topic needs it:ax.plot(x, y)is "take these two arrays, make points, connect them." Arrays are the raw fuel. (Full details live in 1.4.01-NumPy-arrays-and-operations.)
The parent's Seaborn examples build a pd.DataFrame (there's pd, the Pandas nickname from the top).
The picture: a grid; the top row is column names, the cells below are the numbers/labels.
Why the topic needs it: Seaborn's superpower is that you say the column name (x='Optimizer') instead of hand-feeding raw arrays. It reads the table itself. Deep dive: 1.4.02-Pandas-DataFrames-and-data-manipulation.
This is the one hierarchy that trips up every beginner. Build it slowly.
In the figure the big black rectangle is the Figure; the red-outlined inner boxes are two Axes; the little wave and text inside them are Artists.
Why the topic needs it: the parent's "object-oriented pattern" is literally fig, ax = plt.subplots() — make a page, hand me one chart on it. Then ax.plot(...) means "draw on that specific chart." Owning this nesting is the whole reason you can build multi-panel figures.
The parent quietly uses transform=ax.transAxes to pin text. Matplotlib actually offers four ways to say "where," nested from innermost to outermost.
Think of them as four zoom levels of "where": exact data value → fraction of one chart → fraction of the page → actual pixels.
The picture: the same box labelled twice — once with real data numbers, once with 0-to-1 fractions — plus the page-level and pixel wrappers around it.
Why the topic needs it: to place a caption "always in the top-left corner" regardless of the data range, you use Axes coordinates. transform=ax.transAxes tells Matplotlib "read these numbers as fractions of the chart box, not as data." Without it, (0.2,0.8) would be a data point that might fall off-screen.
Why the topic needs it: an unlabelled plot is a lie — nobody knows what they're looking at. Every good figure in the parent (and in 4.1.01-Exploratory-data-analysis) labels axes and adds a legend.
The map below is written in Mermaid, a tiny text language for drawing boxes-and-arrows diagrams (you type the words, it draws the shapes). Read each arrow as "you need the left box before the right box makes sense." Start at any box with no arrow coming in (a raw foundation) and follow arrows forward; every path eventually reaches the topic node at the bottom. We use a diagram here — instead of a paragraph — because a dependency map is exactly the kind of thing eyes read faster than words (the whole point of this topic!).
Each row of the parent note is one of these bricks in disguise: a loss curve is a function on arrays drawn as a line on an Axes; a violin plot is a DataFrame handed to Seaborn.