Data Visualization
About this knowledge base
Data visualization turns data structures, model errors, and system tradeoffs into evidence that people can inspect. It is not “adding a pretty chart to a report.” First identify the argument and unit of data, then choose visual encodings that expose distributions, uncertainty, and failure modes. Agent Engineers use it to inspect data distributions, classification errors, RAG metrics, cost, latency, and version regressions.
Place in the overall path
This course appears late in “Mathematics and Data Foundations.” It connects probability and statistics, machine learning, data cleaning, evaluation frameworks, and runtime monitoring. Basic Python lists/dictionaries and statistics are sufficient to begin.
Learning objectives
- Choose charts from the question and the reader’s intended action, rather than from a plotting-library function.
- Present distributions, relationships, change over time, error, and uncertainty correctly.
- Design combined charts for classification, retrieval, Agent operation, and cost evaluation.
- Detect truncated axes, incorrect aggregation, filtering bias, and misleading use of color.
- Produce reproducible static charts with labels and sources using Matplotlib.
Prerequisites
Be able to create a venv, install packages, and run Python 3 in PowerShell 7. Understand means, medians, quantiles, and sample size. If needed, first study Python Fundamentals, Probability and Statistics, and Data Cleaning. Course examples use fictional aggregate data and require neither a network nor an API key.
Recommended learning order
- From Question to Chart: build a “question → data → encoding → action” decision framework.
- Distributions and Group Comparisons: prevent averages from hiding long tails and subgroups.
- Relationships, Trends, and Time Series: distinguish correlation, change, and aggregation-driven illusions.
- Error and Uncertainty: make error bars, confidence intervals, and repeated runs interpretable.
- Machine Learning, RAG, and Agent Evaluation Charts: place component metrics alongside system tradeoffs.
- Misleading Risk and Accessibility: audit axes, color, filtering, labels, and sources.
- Project: Agent Evaluation Dashboard: generate a four-panel offline evaluation chart and interpret it.
Hands-on practice or project entry point
agent_eval_dashboard.py reads strictly validated fictional evaluation data, plots success-rate Wilson 95% intervals, tail latency and timeouts, a routing confusion matrix, and cost–success-rate Pareto candidates, then exports PNG, SVG, and text alternative descriptions. The course embeds the generated evaluation dashboard. Automated tests cover the data contract, statistics, exact output dimensions, both export types, and the CLI; dependency versions are recorded in requirements.txt.
Mastery criteria
- Given an analytical question, explain why you chose a particular chart and encoding.
- When presenting a mean, also consider distribution, sample size, and uncertainty.
- Read the major errors in a confusion matrix instead of reporting accuracy alone.
- Audit axis range, binning, aggregation, color, and treatment of missing data.
- Generate charts with title, axis labels, units, legend, source, and reproducible code.
- At final size, check missing glyphs, clipping, overlap, grayscale distinguishability, and alternative text.
- Run normal and
-Otests and explain Wilson intervals, row-normalized confusion matrices, and Pareto candidates.
Relationship to the other knowledge-base courses
- Data Cleaning makes the units, missing values, duplicates, and grouping fields shown in a chart trustworthy.
- Machine Learning provides classification/regression metrics, training–validation differences, and error-analysis questions.
- Data Annotation uses charts to inspect class distributions, annotator bias, and disagreement patterns.
- RAG, Evaluation Framework, and Runtime Monitoring must examine retrieval quality, answer quality, cost, latency, and safety subgroups together rather than compressing them into one overall score.
Main references
Sources were checked on 2026-07-18. Matplotlib stable was 3.11.0 at the time (release notes date 2026-06-11), and scikit-learn stable was 1.9.0. Both will continue to change. This knowledge base relies on requirements.txt and actual verification records rather than treating a stable URL as a permanent version.
- Matplotlib documentation
- Matplotlib 3.11 release notes
- Matplotlib installation and non-interactive backends
- Matplotlib Quick start guide
- Matplotlib Plot types
- Matplotlib: Statistical distributions
- scikit-learn: Visualizations
- NIST: Confidence intervals for a binomial proportion
- W3C WCAG 2.2: Use of Color