Can Claude Make a Good Chart? Only With a Charting Kit
The video walks through a charting kit that Claude reads before drawing: five chartkit primitives, three optional data helpers, a four-step workflow and five judgement defaults. Its point is that the kit gives defaults, not good taste.
Does Claude already know how to make a good chart? The video says not quite. Claude is told what to check by a charting kit that it reads before it draws anything. The video then opens that kit up to show what it spells out, and what that does and does not guarantee about the resulting chart.
The five chartkit primitives
The kit is built from five primitives. Theme sets matplotlib rc parameters and returns resolved colors. Its key feature is that foreground colors are derived from the background's luminance, so passing a dark background produces a correct dark chart automatically. Palette builds colors from a base hex value, cycles a list, or falls back to the series defaults. Finish adds the typographic frame: a left-aligned bold title, plus a muted caption that records provenance. Save writes PNG, SVG or both and returns the paths. Write HTML produces a self-contained interactive page by inlining React, React DOM and Recharts from a local directory, so the file opens offline with no CDN dependency.
Three data helpers with skip conditions
Alongside the primitives are three data helpers, each aimed at a specific gotcha. Zero fill days fills calendar gaps in a time series, but it should be skipped when zeros would be a lie because the data is sparsely sampled rather than absent. Rolling mean is trailing, so early points average whatever exists so far, and it should not be centered. Log floor gives a lower bound for bar charts on log scales, where a value equals the axis minimum. All three are optional and used only when they fit. One practical detail is that the absolute path to the graphing scripts directory must go into sys.path, not a relative path, because the working directory is the user's project.
The four-step workflow
The workflow has four steps. First, look at the data and decide what it deserves. Second, infer colors from context, such as a Tailwind config, CSS variables, brand guidelines and semantic meaning. Third, write the script. Fourth, render and look at the result before handing it over. That last step is explicit: check that labels are legible, nothing overlaps, colors are distinguishable and the story of the data is visible, then fix and re-render until it is right.
Five judgement defaults
The kit gives defaults with explicit permission to deviate when the data argues for it:
- Rotate x labels only when they would otherwise collide; short labels stay horizontal.
- Cap bar width when there are only a few categories, and label bars with their values when there are roughly a dozen or fewer.
- Rank categorical bars by value unless the categories have a natural order.
- Make a title state what the chart shows, not the chart type or the column name.
- Show legends only when there is more than one series, and annotate what matters, such as a deploy line, a threshold, the peak or the anomaly. An annotation the reader did not need is clutter.
What the kit does and does not guarantee
Having the kit does not mean Claude always makes the right chart. Where the kit spells something out plainly, such as the first-step judgement call, colors that adapt to the background, or an offline file that just works, Claude follows it and skips the mistake. Where the guidance is a placeholder string swapped by hand or one phrase covering an edge case, Claude can still get it wrong, the same way a person skimming the same page would.
Key takeaways
- Claude reads a charting kit before drawing; it does not simply know good chart practice.
- Theme derives foreground colors from background luminance, so dark backgrounds work automatically.
- Write HTML makes a self-contained interactive page that opens offline.
- The three data helpers are optional and each has a skip condition.
- The workflow is look, infer colors, write, then render and look again.
- The judgement defaults can be overridden when the data calls for it.
- A kit gives defaults and a few marked sharp edges, and Claude only avoids the edges the kit actually marks.
Try it yourself
Pick a dataset you have never charted before, ideally one with a real gap in it or no obvious color to reach for, and give it to Claude. Before it writes any chart code, ask what it will check in the data first and where its colors will come from. Then have it render the result, look at the PNG itself, and say what it would fix before handing the chart to you.
Chapters
Full transcript(auto-generated, with timestamps)
Cold open — does Claude already know how to make a good chart?
[0:00]Someone assumed Claude already knows how to make a good chart. Not quite. It gets told what to check in a kit it reads before drawing. Here's what that kit actually spells out. The kit has five
Anatomy — chartkit primitives + data helpers
[0:10]Primitives and three data helpers. Theme sets matplotlib RC params and returns resolved colors. The key field is that foreground colors derive from background luminance. Pass a dark background and you get a correct dark chart automatically. Pallet builds in colors from a base hex, cycles a list, or falls back to the series defaults. Finish adds the typographic frame, left aligned bold title, muted and provenance caption. Save writes PNG, SVG, or both and returns paths. Write HTML produces a self-contained interactive page by inlining React, React DOM, React as in Recharts from a local third-party directory. The file opens offline with no CDN independency. The three data helpers address specific gotchas. Zero fill days fills calendar gaps in a time series, but skip it when zeros would be a lie because the data is sparsely sampled, not absent. Rolling mean is trailing and early points average whatever exists so far. Do not center it. Log floor gives a lower bound for bar charts on log scales where value equals the axis minimum. All three are optional. Use them only when they fit. The absolute path to graphing scripts directory must go into sys.path, not a relative path, because the working directory is the user's project. The
Design — four-step workflow + judgement defaults
[1:19]Four steps are look at the data and decide what it deserves, infer colors from context, Tailwind config, CSS variables, brand guidelines, and semantic meaning, write the script, and render and look at the result before handing it over. The render and look step is explicit. Check labels for legibility, nothing overlapping, colors distinguishable, the story of the data visible. Fix and re-render until it is right. The judgment section gives defaults with explicit permission to deviate when the data argues for it. Five defaults worth knowing. Rotate X labels only when they would otherwise collide. Short labels stay horizontal. Cap bar width when there are a few categories. Label bars with their values when there are roughly a dozen or fewer. Rank categorical bars by value unless the categories have a natural order. A title states what the chart shows, not the chart type. Not the column name. Legends only when there is more than one series. Annotate the chart with what matters. A deploy line, a threshold, the peak, the anomaly. An annotation the reader did not need is clutter.
Both directions — documented plainly vs. easy to miss
[2:15]So, does having this kit mean Claude always makes the right chart? Not exactly. Where the kit spells something out plainly, the first step judgment call, colors that adapt to the background, an offline file that just works, Claude follows it and skips the mistake entirely. Where it's a placeholder string swapped by hand or one phrase covering an edge case, Claude can still get it wrong the same way a person skimming the same page would. A charting kit doesn't give
Carry-out
[2:37]Claude good taste. It gives Claude judgment defaults to start from and a few sharp edges marked and Claude only dodges the edges the kit actually marks.
Your turn
[2:47]Your turn. Here's the prompt. Read it with me. Give Claude a data set you've never charted before, something with a real gap in it or no obvious color to reach for. Before it writes any chart code, ask what it's going to check in the data first and where the colors are coming from. Then have it render the result, look at the PNG itself and say what it would fix before handing it to you. Claude graphing. Lay 'em in for bear.
More from Claude
2:30HubSpot API: Ask for Every Field, or You Get Almost None
2:49Claude Meets an API It's Never Seen: The Grafana API Skill
2:13Jira API: Claude Can't Set Status — It Has to Transition
1:46Google Drive API with Claude: Find Every File, Skip the Traps
2:29Linear Has No REST API — One GraphQL Endpoint, Two ID Systems
2:19