Start studying
Module 8 · Visualisation Module contents
Module 8  ·  Card 13 / 13intermediate

Plotting Libraries

Plotting libraries draw charts from code, so a chart can be rebuilt exactly whenever the data changes.

In Python, Matplotlib gives fine control over every element, and several other libraries, such as Seaborn, build on it.

Seaborn draws statistical charts such as box plots and heatmaps straight from a DataFrame in one call.

Plotly makes interactive charts that readers can hover over, zoom and filter in a browser.

For example, a weekly report script can redraw the same 6 charts from fresh data with no manual steps.

Learn in depth ↓
Module 08 · Visualisation · 13 concepts
In depth  /  15 lines

Plotting Libraries, in more detail

Plotting libraries turn charts into code, which means every chart can be checked, repeated and changed.

A chart made by clicking can only be rebuilt by clicking again, while code rebuilds it in seconds.

That matters most for reports that repeat weekly or monthly with fresh data.

Matplotlib is the long-standing base of Python plotting and controls every line, label and tick mark.

Its detail is also its cost, since a polished chart can take many lines of code.

pandas has a plot method on every DataFrame that draws quick Matplotlib charts for exploration.

Seaborn sits on top of Matplotlib and draws grouped statistical charts directly from DataFrame columns.

Plotly draws interactive charts that run in a browser, with hover labels, zoom and filtering.

Interactive charts suit dashboards and exploration, while static images suit printed reports and slides.

In R, ggplot2 builds charts in layers from a grammar of graphics, an approach some Python tools also follow.

Most libraries can save charts as image files, and some can also save them as web pages.

Defaults differ between libraries, so a chart's clarity still depends on choices made in the code.

Setting shared styles once, such as fonts and colours, keeps every chart in a report consistent.

In practice analysts often explore with pandas or Seaborn and polish final charts with Matplotlib or Plotly.

The usual mistake is accepting the library's default chart, which is rarely the clearest one for the question.

Want the full technical article? Wikipedia ↗
Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
An analyst rebuilds the same 6 charts by hand in a spreadsheet every week. What does moving them into a plotting library mainly fix?
Visualisation

13 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close