๐Ÿ–ฅ๏ธ Week 01, Day 04 - Lecture

From Data to Insight: A Visualisation Workshop

Author

Dr Jon Cardoso-Silva

Last updated

17 July 2025

๐Ÿฅ… Learning Objectives

By the end of this session, you should be able to: i) Translate a sketched visualisation idea into functioning Python code using AI assistance, ii) Navigate and draw inspiration from professional data visualisation galleries, iii) Critically evaluate the effectiveness of a data visualisation, iv) Use an AI assistant to refactor and improve existing plotting code, v) Understand the workflow of progressing from raw data to a final, insightful visualisation.

ME204 course icon

Welcome back. Today we are doing something different. Instead of a traditional lecture with slides, weโ€™re going to dive straight into a hands-on workshop. Our entire session will be built around a single, powerful idea: turning raw data into a compelling visual story.

Our goal today is not to master every single command in Matplotlib or Seaborn. Itโ€™s to understand the workflowโ€”the journey from a question, to data, to an insight that you can share with others.

โฐ Thursday, 17 July 2025 | 10:00am - 1:00pm ๐Ÿ“ Location: CKK.2.06 (see LSEโ€™s ๐Ÿ—บ๏ธ campus map)

Hour 1: The Destination First

10:00 โ€“ 11:00

Iโ€™m going to start by showing you the end result.Open up the NB03 notebook. You can download it here if you need to:

I suggest you save it to your me204-study-notes repository that you created yesterday.

At the very bottom of the notebook, youโ€™ll find this plot:

Note: 2025โ€™s data is only up to 15 July 2025. The bar for 2025 is not necessarily complete.

There are TWO NOTEBOOKS today. This is just the polished one, the second one can be found in Hour 3 and will have a walkthrough of the data preparation steps.

Our task for this first hour is to work backwards. How did we get from a raw API call to these specific, insightful visualisations? We will walk through the NB03 notebook together, focusing on the pandas transformations that make these plots possible.

โ˜•๏ธ Coffee Break

11:00 โ€“ 11:15

Hour 2: Building Visual Literacy

11:15 โ€“ 12:00

Now itโ€™s your turn to be the critic.

Group Activity

In your teams, your task is to find and critique data visualisations in the wild.

  1. Find Examples (15 mins): Look for charts, graphs, or maps in:
    • Official reports (e.g., from the ONS, World Bank, or government bodies)
    • News articles (e.g., The Financial Times, The Economist, BBC News)
    • Academic papers in your field of interest.
  2. Critique (15 mins): For each visualisation, discuss:
    • What works? What is the chartโ€™s main message? Is it clear? Is the title effective?
    • What doesnโ€™t? Is it cluttered? Misleading? Could the colours be better? Is the key message buried?
  3. Share (10 mins): Each group will share one โ€œgoodโ€ example and one โ€œbadโ€ example with the class, explaining your reasoning.

๐Ÿคธ Quick Stretch Break

12:00 โ€“ 12:10

Hour 3: From Raw Data to Insight

12:10 โ€“ 13:00

This final hour is dedicated to a guided walkthrough of the LSE_ME204_W01D04_lecture.ipynb notebook. We will work through it together, focusing on the critical data transformation steps that bridge the gap between a raw API response and a final, communicative plot.

Our focus will be on understanding the how and the why:

  • Operationalising a Question: How do we translate a concept like โ€œheatwaveโ€ into a concrete set of rules a computer can understand?
  • The Logic of .diff() and .cumsum(): Weโ€™ll dissect the pandas code used to identify consecutive events in a time series. This is a powerful technique you can adapt for many other problems.
  • Creating the โ€œFinal Dataframe Pre-Analysisโ€: We will reinforce the core philosophy of the course: shaping your data into the exact format needed for your plot before you call the plotting function.
  • The Full Workflow: Weโ€™ll connect the dots from the initial question, through the transformation, to the final visualisation, ensuring you understand the complete process.

๐Ÿ“š Further Learning & Resources

Here are some excellent resources to continue building your data visualisation skills.

Matplotlib Resources

  • Plot Types Gallery: The best place to start. See all the different charts you can make.
  • Anatomy of a Figure: A fantastic breakdown of all the named components of a plot.
  • Tutorials: Deeper dives into specific aspects of the library.

Seaborn Resources

  • Example Gallery: An inspiring collection of beautifully styled statistical plots.
  • Official Tutorial: A comprehensive guide to the libraryโ€™s main functions and features.
  • API Reference: The definitive source for every function and its parameters.