OVP vs prompting matplotlib vs Vega-Lite, for agents
If an AI agent has to turn data into a chart, it has three options: write plotting code from a prompt, emit a Vega-Lite spec, or resolve an OVP object. They solve different parts of the problem. This page is the honest comparison, including where OVP is the wrong tool.
The one-line difference
- Prompt a plotting library (matplotlib, Plotly): the model writes fresh code every time. Maximum flexibility, zero guarantees.
- Vega-Lite: a precise visualization grammar. You declare the encoding and it renders the same picture every time. It does not decide which chart the message needs, and it ships no house style.
- OVP: a decision layer and a determinism contract on top of a closed set of 74 chart objects and 16 design languages. It picks the chart, defends the choice, and renders the same pixels from any agent or renderer.
Side by side
| Prompt matplotlib | Vega-Lite | OVP | |
|---|---|---|---|
| Same input, same output | No. The model improvises; two runs diverge | Yes, once you have written the spec | Yes. Byte-identical goldens are the conformance suite |
| Chart choice | Whatever the model guesses this time | Yours to specify; the grammar does not advise | Resolved from audience, purpose and message, with the pattern and decider that justify it |
| House style | Different every run | Hand-themed per project | 16 named languages; colors are roles, not hex |
| Honesty guardrails | None | None | Anti-patterns, warn-level charts, and QA checks: pies cap at three slices, waterfalls must reconcile, cumulative curves never fall |
| Output formats | PNG via a code sandbox | SVG or canvas via a JS runtime | SVG and PPTX from one spec, member-identical decks |
| What the agent loads | Re-derives styling and layout on every call | A verbose spec per chart | One registry lookup plus a self-contained copy block |
| Fails loudly on bad input | No; it renders something plausible | Partially; schema-invalid specs error | Yes; the gate rejects off-vocabulary intent and unsound data |
Where each one wins
- Reach for a plotting library when the chart is bespoke or exploratory and reproducibility does not matter: a one-off notebook figure, a novel encoding no catalogue has.
- Reach for Vega-Lite when you want a precise, interactive web chart and you already know the encoding you want. It is an excellent renderer and a clean grammar.
- Reach for OVP when the output must be consistent, defensible, and repeatable across many charts, people, and runs: recurring reports, agent-generated decks, a team that needs the same chart to look the same every week.
OVP composes with them, not against them
OVP is a layer, not a renderer lock-in. Its tokens already export as matplotlib styles, Plotly templates, and Vega-Lite config blocks (see the report-themes companion repo), so you can keep your existing renderer and still inherit the 16 languages. The decision and determinism live in OVP; the drawing can live wherever you like.
The agent-specific case
For an autonomous agent the failure mode of free-form prompting is not ugliness, it is silent plausibility: a chart that looks right and encodes the wrong thing, differently each run, with no way to test it. OVP replaces "generate a chart" with "resolve an object and render it", which is a lookup with a known-good answer and a golden to check against. That is the whole pitch: deterministic and honest, not plausible.