Beyond the big four, Matplotlib offers many specialised charts. Knowing which answers your question is more important than any one syntax.
Box plots
A box plot summarises a distribution's median, quartiles and outliers — ideal for comparing distributions across groups:
ax.boxplot([group_a, group_b, group_c], labels=["A", "B", "C"])
Pie, area & error bars
ax.pie(sizes, labels=labels, autopct="%1.1f%%") # part-to-wholeax.fill_between(x, y_low, y_high, alpha=0.3) # shaded area/rangeax.errorbar(x, y, yerr=errors, fmt="o") # points with uncertaintyax.stackplot(x, a, b, c, labels=["a","b","c"]) # stacked area
Key takeaways
- 01Box plots summarise median, quartiles and outliers — great for comparing distributions.
- 02fill_between shades a range/area; errorbar shows uncertainty.
- 03stackplot draws stacked areas over a continuous x.
- 04Prefer bars over pie charts — angles are hard to compare accurately.
