π» Week 01, Day 04 - Lab
The Visualisation Workflow (Sketch, Explore, Refactor)
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.
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
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.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.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 II: Gallery Exploration (25 min)
Now, letβs get some inspiration from the pros. The goal is to quickly see whatβs possible.
π― ACTION POINTS
Browse Matplotlib (10 min):
Quickly explore the Matplotlib Plot Types Gallery and find one chart youβd like to play with using the
london_heatwave_df
DataFrame.Browse Seaborn (10 min):
Do the same with the Seaborn Example Gallery.
Share (5 min):
In Slack, post a link to your favourite of the two plots and add a brief note on why you chose it.
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
Start with a βboringβ plot (5 min): Use one of the plots youβve already created.
Improve it with AI (20 min):
Use an AI assistant to make the plot better.
Stuart will give you ideas for prompts.