Milestone 6 of 8

Create a visual quality report

Plot status counts and valid readings while retaining the source identity behind every point.

Numbers can show how many rows were classified and where valid readings lie. This milestone turns those same facts into one small figure. The figure is evidence produced from the data, not a replacement for the saved records.

Milestone goal

Create output/quality_report.png with a status-count view and a scatter plot of valid readings by observation and sensor.

Inputs and figure contract

Use the classified outputs and quality_summary.json. Implement an interface such as:

The figure must contain two clearly labelled axes:

  1. a bar chart with status counts in the fixed order valid, missing, rejected, including a bar of height zero when a status is absent;
  2. a scatter plot of valid rows only, with observation on the horizontal axis and reading on the vertical axis. Use separate visible markers or colors for north and south, and include a legend.

Set axis labels and concise titles. Do not connect points across missing or rejected observations. Do not infer a trend, outlier, sensor cause, or data quality claim from the picture.

Preserve the source ID and line for every plotted point in the underlying plot-data record or an equivalent trace. The image alone cannot prove which row produced a point.

Deliverables

Produce:

  • output/quality_report.png;
  • the plotting function and orchestration needed to regenerate it;
  • a small trace or report section that maps at least two plotted points back to their record_id and source line;
  • the figure dimensions, axis labels, status order, and sensor order used by the plot.

The plot must be generated from the reader's classified data. A hand-drawn or publication-supplied placeholder does not satisfy this milestone.

Checks

Check the underlying figure data before looking at pixels:

  • status bars use the summary's three counts and fixed order;
  • every scatter point is a valid row;
  • each plotted observation and reading equals its source record;
  • sensor labels are present and stable;
  • no missing or rejected row appears as a valid point;
  • axis labels and legend entries are present;
  • the PNG is written and can be opened after the process ends.

Use an alternate fixture with no valid rows and confirm that the status panel still renders while the scatter panel contains no fabricated points. A visual review should also confirm that labels, markers, and empty states remain readable.

Review

Pick one point from each sensor and trace it through the classified record and the saved plot data. Then inspect one missing and one rejected row. The report should make their absence from the scatter plot unsurprising.

Next step

The manifest and findings milestone will record which source, schema, outputs, counts, and figure produced this report. Keep the plotting choices explicit so that the manifest does not describe a different run from the image.

HintPlot data before style
Build and inspect the arrays sent to Matplotlib before choosing colors or markers. A polished figure with the wrong rows is still wrong.
HintDo not join across absence
A line through valid points would suggest a continuous measurement sequence. This milestone asks for a scatter plot so missing and rejected rows remain visible as gaps in the evidence.

How to check your work

The supplied fixture shows a compact two-axis figure and its plot-data trace. Compare labels, counts, and source mappings before comparing style.