πŸ’» Week 01, Day 04 - Lab

The Visualisation Workflow (Sketch, Explore, Refactor)

Author

Dr Jon Cardoso-Silva

Last updated

17 July 2025

πŸ₯… Learning Objectives

By the end of this lab, 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 (Matplotlib and Seaborn), iii) Use an AI assistant to refactor and improve existing plotting code.

ME204 course icon

Welcome to the afternoon lab. This session is all about the process of creating visualisations. We’re not aiming for one perfect chart; we’re aiming to master a workflow that you can use for any data project. Our focus is on how to think like a data visualiser: moving from a rough idea to a polished, effective plot.

⏰ Thursday, 17 July 2025 | Either 2:00-3.30pm or 3.30-5:00pm πŸ“ Check your timetable for your class location


Part I: Sketch to Code (40 min)

The best visualisations start with an idea, not with code.

🎯 ACTION POINTS

  1. Sketch (10 min): On paper, draw your ideal plot using the heatwave data (NB03). Be clear, not artistic. Label the axes, title, and the story you want to tell.

  2. Prompt (10 min): Write a clear prompt for an AI assistant. You must include your goal, the structure of the london_heatwave_df DataFrame, and an image of your sketch. Then, ask for the code.

  3. Generate & Refine (20 min): Use the AI’s code in your notebook. It won’t be perfect. Iterate with the AI to refine the code until the output matches your vision.

Part III: AI Refactoring (25 min)

Great code is often refined, not written perfectly the first time. Let’s practice improving an existing plot.

🎯 ACTION POINTS

  1. Start with a β€œboring” plot (5 min): Use one of the plots you’ve already created.

  2. Improve it with AI (20 min):

    Use an AI assistant to make the plot better.

    Stuart will give you ideas for prompts.