I've been learning Python data
visualisation, working through Murat Durmus's Hands-On Introduction to
Essential Python Libraries and Frameworks alongside the official Dash tutorial. The resulting code
was functional — a basic bar chart comparing data for San Francisco and
MontrĂ©al — but it looked like exactly what it was: a beginner's first attempt.
Plain white background, default colours, numbered axes, and a title that just
said "Data Viz."
So I decided to run an
experiment. Could Claude AI turn a scrappy 20-line script into something
genuinely worth showing people?
The First Prompt
I pasted the code into
Claude.ai with a simple instruction: "Rewrite this following code to be
graphically more interesting."
The result was striking. Claude
switched to a dark "neon terminal" aesthetic — deep navy background,
electric teal and magenta accents, and a stylish monospaced font. The bars got
proper labels, the axes were cleaned up, and the whole thing felt intentional
rather than accidental. It had gone from looking like homework to looking like
a developer portfolio piece.
Refining for a Real Audience
I pushed further. Same code,
new prompt: "Rewrite this to be graphically more interesting for a
general audience. Choose whatever works best for this audience."
This time Claude made very
different choices — and that's the interesting part. Recognising that a general
audience needs warmth and clarity rather than technical cool, it switched to a
bright, friendly design. Rounded bars in coral and teal, a clean white card
layout, and a Nunito font that feels approachable rather than intimidating. It
even added summary stat cards above the chart — showing the average and peak
month for each city — so someone who doesn't want to "read" a chart
can still instantly understand the data.
What I Noticed
The code grew substantially. My
original 20 lines became well over 150 — defining colour palettes, layout
styles, hover tooltips, and summary components. That might sound like more
complexity, but it's actually the opposite: Claude generated the boilerplate so
I didn't have to. The finished app is more readable for users, even if
there's more code underneath.
The bigger lesson? The prompt
matters as much as the tool. "More interesting" and "more
interesting for a general audience" produced completely different results
— one optimised for aesthetics, one for usability.
Code based
on dash.plotly.com/tutorial and Murat Durmus (2023), pages 143–145.
References
Anthropic.
(2024). Claude AI [Large language model]. Retrieved from https://claude.ai
Durmus,
M. (2023). Hands-on introduction to essential Python libraries and
frameworks (pp. 143–145). Amazon KDP. Retrieved from https://www.amazon.com
Comments
Post a Comment