Checkpoint: Chart Types

A checkpoint is a review lesson that pulls every chart type from this section together, so you can practice picking the right visualization for a given dataset and build a multi-panel figure end to end.

Learn Checkpoint: Chart Types in our free Matplotlib course — a beginner-friendly interactive lesson with worked examples, a practice exercise and a quick…

Part of the free Matplotlib course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.

You'll recap box and violin plots, grouped and stacked bars, error bars, fill_between, stem and step plots, polar plots, hexbin, and stackplots — then prove it by building a small dashboard and acing a quiz.

Each chart in this section answers a specific question. The fastest way to choose is to ask what you're trying to show , then pick the chart built for it. Keep this table handy — it's the heart of the whole section.

Time to put it together. Below is a starter that sets up a 2×2 grid of axes and hands you four datasets. Your job: pick the right chart for each panel and draw it. Think before you code — which chart answers each dataset's question? Try it yourself first, then open the solution to compare.

The logic: distributions call for a box plot, a revenue split over time is a stackplot, a 20,000-point cloud needs hexbin, and a noisy trend wants a line with a fill_between band. Same toolbox, four different jobs.

One subtlety: a polar panel needs polar axes, which you request per-subplot. Use the subplot_kw trick or build a mixed figure where one axis is polar. Here's a compact example pairing a grouped bar chart with a radar-style polar bar — proof you can mix projections in one figure.

What you'll see: a normal grouped bar chart on the left and a green radar-style polar bar chart on the right, living happily in one figure — exactly the building block of a real dashboard.

Replace each ___ to pick the right call for each panel: a density map and a stacked area chart.

You called set_theta_zero_location on normal axes. Create the axis with projection="polar" first.

Call plt.tight_layout() (or fig.tight_layout() ) after drawing all panels to space them out.

If a scatter is a blob, switch to density; if you need parts of a whole, stack; if comparing distributions, use box or violin.

Build a one-row report: error bars for measured points, a stacked bar of a budget, and a hexbin density map — each chosen for its data.

⏱ Timed Quiz

Answer each in your head, then click to reveal. No peeking first!

A density plot — ax.hexbin(x, y) or ax.hist2d(x, y) . Both bin the points and color each cell by count so the structure shows through even when points overlap.

Grouped bars sit side by side (offset with x ± width/2 ) to compare series within a category. Stacked bars sit on top of each other (using bottom= ) to show the category total and its breakdown.

A violin plot. It draws a smoothed density curve, so a bimodal distribution shows two bulges, while a box plot would flatten it into a single box.

Use ax.fill_between(x, y - err, y + err, alpha=0.3) to wrap the line in a translucent confidence band — cleaner than dozens of individual error bars for dense data.

projection="polar" — passed via subplot_kw={"projection": "polar"} to plt.subplots() or to fig.add_subplot() . Then you plot with angle (theta) and radius (r).

A 100% stacked area chart — normalize each series by the column total ( series / total * 100 ) and draw with ax.stackplot() so the bands always fill the full height and reveal share.

Checkpoint complete — you can choose and combine chart types!

You recapped all eight chart types, matched each to the question it answers, built a multi-panel dashboard, mixed Cartesian and polar projections, and tested yourself with the quiz.

🚀 Up next: Complex Layouts with GridSpec — arrange panels of any size precisely.

Practice quiz

You have 50,000 (x, y) points and a scatter plot looks like a solid blob. What should you switch to?

  • A bigger figure
  • A pie chart
  • A density plot like hexbin or hist2d
  • A box plot

Answer: A density plot like hexbin or hist2d. Density plots (hexbin/hist2d) bin the points and color each cell by count, so structure shows through even when points overlap.

What is the difference between grouped and stacked bars?

  • Grouped sit side by side; stacked sit on top using bottom=
  • They are identical
  • Stacked bars sit side by side
  • Grouped bars require a colorbar

Answer: Grouped sit side by side; stacked sit on top using bottom=. Grouped bars are offset side by side (x ± width/2) to compare series; stacked bars use bottom= to show a total and its parts.

Which chart reveals a bimodal distribution that a box plot would hide?

  • A bar chart
  • A stem plot
  • A polar plot
  • A violin plot

Answer: A violin plot. A violin plot draws a smoothed density curve, so two peaks appear as two bulges, while a box plot flattens them into one box.

How do you shade the uncertainty band around a smooth trend line?

  • ax.errorbar on every point
  • ax.fill_between(x, y - err, y + err, alpha=0.3)
  • ax.hexbin(x, y)
  • ax.stackplot(x, y)

Answer: ax.fill_between(x, y - err, y + err, alpha=0.3). fill_between wraps the line in a translucent band between y - err and y + err, cleaner than many individual error bars.

What single keyword turns normal axes into polar axes?

  • projection="polar"
  • polar=True on plot
  • kind="polar"
  • radial=True

Answer: projection="polar". Pass projection="polar" to add_subplot or via subplot_kw to plt.subplots, then plot with theta and r.

Which chart best shows parts of a whole changing over time?

  • A scatter plot
  • A box plot
  • A stackplot (stacked area)
  • A hexbin

Answer: A stackplot (stacked area). stackplot stacks series so you see both the total and each component's share over time.

Which call draws stacked bars by placing one series on top of another?

  • ax.bar(x ± width/2, ...)
  • ax.bar(..., bottom=)
  • ax.barh(...)
  • ax.hist(...)

Answer: ax.bar(..., bottom=). Passing bottom= (the cumulative height of prior series) stacks each bar on top of the previous one.

Which chart pair is right for comparing the distribution of several groups?

  • pie and donut
  • stem and step
  • hexbin and hist2d
  • boxplot and violinplot

Answer: boxplot and violinplot. boxplot and violinplot both summarize distributions; box shows quartiles/outliers, violin shows full shape.

What does ax.step() emphasize compared to ax.plot()?

  • Smooth curves
  • Stepwise, discrete-level changes
  • Density of points
  • Angular data

Answer: Stepwise, discrete-level changes. step draws horizontal-then-vertical segments, ideal for discrete or stepwise signals that hold a value then jump.

For a dense scatter of 20,000 points, which gives a readable density map?

  • ax.scatter with small markers
  • ax.plot with a line
  • ax.hexbin with gridsize
  • ax.bar

Answer: ax.hexbin with gridsize. hexbin aggregates points into hexagonal bins colored by count, revealing density that an overplotted scatter hides.