Learn matplotlib

How this course works, what the workbench can do, and the chapter list.

This is a full matplotlib course for the Swiftener Matplotlib editor. NumPy is already imported as np. Matplotlib is plt. You type in that tab, press Ctrl+Enter (or Cmd+Enter), and call plt.show() so the figure appears in the Plot panel.

You do not install Python, pip, or Jupyter. Code and uploaded files stay in your browser.

Arrays without plots belong in Learn NumPy. Tables belong in Learn pandas. Statistical plots of DataFrames belong in Learn seaborn. This course stays on matplotlib figures.

Goal

Finish every chapter by running the copy-paste blocks in the workbench. The last chapter is a small rainfall dashboard you can reuse.

How to take the course

  1. Keep this tutorial tab and the Matplotlib workbench side by side.
  2. Wait until the workbench status says matplotlib is ready.
  3. Copy an exercise, paste it as the whole editor, run it, then look at the Plot panel. Each shaded block is a complete script — it does not rely on leftover variables.
  4. Every block ends with plt.show(). Without it, the figure may not appear.
  5. When a chapter asks for a file, download it from the buttons above, then click Add files in the workbench.

The workbench Snippets menu is a cheat sheet. Prefer the exercises here — they are written for this editor.

What this editor can and cannot do

  • Can: np, plt, print, CSV / text uploads, plt.show(), plt.savefig to /uploads, downloads.
  • Cannot: Jupyter magics (%matplotlib inline), pandas DataFrames, 3-D / animation, installing extra PyPI packages beyond what the app already loads (numpy, matplotlib). For seaborn, use the Seaborn editor and Learn seaborn.
  • Always print(...) for console text. Always plt.show() for figures.

City names in the examples are Nairobi, Mombasa, Kisumu (then Nakuru and Eldoret on the sample files).

Sample files

Download any of these from the banner, then attach them with Add files:

  • units.csv — 5 cities × products A, B, C
  • prices.csv — three product prices
  • rainfall.csv — Jan–Apr millimetres for the same cities
  • temps.txt — whitespace daily max °C (Nairobi, Mombasa, Kisumu)

Chapter list

Work in order the first time. After that, jump around from the sidebar.