Scatter plots show pairs
A scatter plot places one point for each observation. It is the right first look at the relationship between two numeric variables: direction, clusters, gaps, and outliers become visible before any model is fitted.
Python
One point per student
Output
Press Run to execute this cell. The first run downloads Python; later runs reuse the session.
A pattern in a scatter plot is not proof of causation. It can suggest a relationship worth testing, but confounders and measurement choices still matter.
Encode carefully
Point size, color, and transparency can carry additional information. Use them when the extra dimension matters, and stop when the chart becomes harder to read. Overlapping points often need transparency more than decoration.
Python
Size encodes class size
Output
Press Run to execute this cell. The first run downloads Python; later runs reuse the session.
Histograms show one variable's shape
A histogram divides the range of one numeric variable into bins and counts how many observations fall in each bin. It answers questions about center, spread, skew, and gaps that a list of numbers does not.
Python
Counts across six score bins
Output
Press Run to execute this cell. The first run downloads Python; later runs reuse the session.
The bin count changes the picture. Too few bins hide structure; too many bins turn random noise into apparent spikes. Try a few sensible values before drawing a conclusion.
Add a reference line
A vertical or horizontal reference line can show a mean, target, or threshold. Draw it after the data so it sits on top, and label it in the title or a legend rather than leaving an unexplained line.
Python
A labelled reference line
Output
Press Run to execute this cell. The first run downloads Python; later runs reuse the session.
The next lesson controls layouts and styling across a whole figure: multiple axes, spacing, annotations, and a visual system that stays legible.
Practice
Make it stick
Run the tests as often as you like. Hints and the solution are available when you need them.
Exercise
Draw a histogram of scores with 6 bins and white edges. Set the title to "Score distribution", xlabel to "Score", ylabel to "Students", and add a horizontal-only grid.
Your solution
ReadyResults
Run the tests to check your solution. The first run downloads Python; later runs reuse the session.
Quiz
Check your understanding
Lesson progress