Turn data into clear, professional charts: 10 hands-on Jupyter lessons covering every core Matplotlib plot, from line and bar charts to time series, subplots and real-time animation.
Choosing the right chart for the question is as important as drawing it. Each lesson explains when to use a plot type, then builds it step by step, from a basic version to a polished, publication-ready figure: using real datasets such as developer salaries, programming-language popularity and Bitcoin prices.
| # | Lesson | What you'll learn |
|---|---|---|
| 1 | Line charts | Plotting two numerical variables, styling lines, markers, labels, legends and grids |
| 2 | Filling area on line plots | fill_between(): shading the gap between Python and overall median salaries by age |
| 3 | Bar charts & analysing CSV data | Vertical, grouped and horizontal bars; reading a CSV and charting the most popular languages |
| 4 | Pie charts | Showing parts of a whole: labels, wedges, colours, explode, shadows and percentages |
| 5 | Stack plots | Visualising how parts contribute to a total over time |
| 6 | Histograms | Distributions, custom bins, log scale and median lines on a real-world dataset |
| 7 | Scatter plots | Relationships between two variables: size, colour maps, colour bars and log scales |
| 8 | Time series | Date formatting and plotting real Bitcoin price data over time |
| 9 | Real-time plotting | Refreshing a chart live as new random data is appended to a CSV |
| 10 | Subplots | Stateful vs. object-oriented Matplotlib; several plots on one or many figures |
git clone https://github.com/ahmadhassan-aiops/matplotlib.git
cd matplotlib
pip install matplotlib pandas numpy jupyter
jupyter notebookEvery dataset sits next to the notebooks, so each lesson runs as soon as you clone the repo. On Google Colab, upload the notebook together with its CSV file.
| File | Used in |
|---|---|
data filling area.csv |
Filling area on line plots |
data bar chart.csv |
Bar charts & analysing CSV data |
data histo.csv |
Histograms |
data scatter plot.csv |
Scatter plots |
data TIME SERIES.csv |
Time series |
| generated by the notebook | Real-time plotting |
data subplot.csv |
Subplots |
Python basics β NumPy β Pandas β Matplotlib β Seaborn β Statistics β Machine Learning
- π Python for Data Science
- π’ NumPy
- πΌ Pandas
- π Matplotlib β you are here
Ahmad Hassan | AI/ML Engineer & Instructor with 5+ years of experience 1,500+ hours of live teaching, 100+ students mentored from medicine, business and engineering into data roles.
β If these notebooks help you learn, please star the repo. It helps other students find it!