# Draw a residual plot in VectorPaint: observations, predictions and zero

Language: en
Canonical: [Draw a residual plot in VectorPaint: observations, predictions and zero](<https://allluckly.cn/en/guides/vectorpaint-residual-plot-observed-predicted-zero-line/>)
中文：[中文 HTML](<https://allluckly.cn/guides/vectorpaint-residual-plot-observed-predicted-zero-line/>)
English: [English HTML](<https://allluckly.cn/en/guides/vectorpaint-residual-plot-observed-predicted-zero-line/>)
Published: 2026-11-26T00:00:00+08:00
Modified: 2026-11-26T09:57:59+08:00
Author: Bison

Calculate residuals for five fictional points and plot them around zero without overstating a pattern.

English translation of the [Chinese original](<https://allluckly.cn/guides/vectorpaint-residual-plot-observed-predicted-zero-line/>), translated on 2026-11-26. Original publication dates, attribution, code and version notes are retained.

Calculate residuals for five fictional points and plot them around zero without overstating a pattern.

## Define data and prediction

Use fictional x values 0, 1, 2, 3, 4 with observed y values 2, 2, 5, 6, 10, and the given line ŷ=2x+1. The line is supplied for the exercise; VectorPaint is not asked to fit it automatically and it predicts no real outcome. OpenStax defines residual as observed minus predicted, which can be positive, negative or zero.

## List predictions first

Substitution gives predictions 1, 3, 5, 7, 9. For example, at x=3, ŷ=2×3+1=7; 3 itself is not the predicted value. Make a paper table with x, observed y and predicted ŷ in each row so values do not become mismatched after sorting. No residuals have yet been plotted; retain both the model and sample.

## Calculate each residual

Observed minus predicted gives 1, −1, 0, −1, 1. For example, at x=1, 2−3=−1; at x=4, 10−9=1. Check signs individually; do not reverse the subtraction while keeping the old interpretation. Residuals have the same units as y. The example has no real unit, so label it as exercise units; zero means observation equals prediction for that point.

## Set up residual axes

Create a landscape canvas in VectorPaint and save the editable original. Use visible line, shape and text controls to draw x from 0 to 4 and residual at least from −2 to 2. Put residual zero midway in the vertical range and label positive and negative ticks clearly; zero need not be the canvas’s physical center. Do not reuse the original y range as the residual range by accident.

## Use consistent scales and guides

For example, use 100 canvas units per x unit and 80 per residual unit. The axes may have different scales, but each axis must be internally uniform. Draw light guides or ticks before emphasizing residual=0. Canvas units are an exercise scale, not necessarily device pixels. If precise entry is unavailable, use visible rulers and identify the chart as a manual approximation.

## Place five points

Plot (0,1), (1,−1), (2,0), (3,−1), (4,1) from the table, using consistent clear marks. The x=2 point sits on zero; do not omit it because it overlaps the line. Check each x position, then the distance above or below zero. Connecting adjacent points is not required.

## Interpret signs

Residuals at x=0 and x=4 are positive: observed values exceed predictions by one. At x=1 and x=3 they are negative: observations are one below predictions. The x=2 residual is zero because 5 equals 5. Signs indicate position relative to the model, not whether a sample is good or bad, and do not establish causation. Use the same sign definition in the legend and table.

## Keep a recalculable table

List five rows beside the chart: x/observed/predicted/residual are 0/2/1/1, 1/2/3/−1, 2/5/5/0, 3/6/7/−1, and 4/10/9/1. Recompute each subtraction and compare chart coordinates with the table. This is a text alternative that does not depend on point color. If labels crowd points, move the text, not the data marks.

## Describe the pattern cautiously

Both endpoint residuals are +1, while two middle residuals are −1 and one is 0. Describe this as a curved arrangement in a small fictional sample. It can prompt inspection of model form, but five fictional points do not prove a real relationship, significance, causation or valid extrapolation. Do not draw a smooth line through points and present it as a fitted real curve.

## Compare one changed observation

Duplicate the original and change only the observed value at x=2 from 5 to 6 while retaining the supplied line ŷ=2x+1. The prediction remains 5, so that residual changes from 0 to +1; all other points remain unchanged. Update both point and table, and state that the model was not refitted. Do not claim the original line must still be the best fit after changing data.

## Check labels and readability

Title the figure “Residual plot for fictional data,” label x and label the vertical axis “observed − predicted.” The zero line and negative signs must not depend on red and green. At small size inspect all four nonzero points and ensure the zero point is not hidden by the line. Check minus signs and the prediction notation. If ŷ cannot render, define “predicted y” consistently in the legend.

## Cross-check original points

List original points separately: (0,2), (1,2), (2,5), (3,6), (4,10). Do not put them directly on the residual vertical axis. At x=3, the original height is 6, the prediction is 7 and the residual height is −1. A separate original scatterplot with the given line can illustrate the vertical difference; label the two vertical axes distinctly. Copying x while retaining original y does not produce residuals.

## Check arithmetic and point count

The five residuals sum to 1−1+0−1+1=0, but a zero sum does not prove that each point is correct and is not a universal rule. Check that each of the five x values appears once, including the zero residual at x=2; if only four points are visible, check whether the zero line hides the marker. Keep the original and changed tables, state whether the model was refitted, and do not mix observations and predictions from different versions.

## Compare average absolute residuals across the two versions

Add a row beside the original table for mean absolute residual: take absolute values 1, 1, 0, 1, 1, sum them to 4, then divide by 5 to obtain 0.8 practice units. In the copy that changes only the observation at x=2, the five absolute residuals are 1, 1, 1, 1, 1, averaging 1. That copy retains the original prediction line; it does not refit the model. Put each value next to its own graph to check the effect of the edit, but five-point means cannot establish accuracy on new data. Averages with different units, sample scopes or calculation methods are not directly comparable.

## Save and troubleshoot

Save the editable original and use a visible share or export control to save a separate PNG or PDF. Reopen it and check all five points, zero line, negative signs, table and canvas edges. If x=1 appears at +1, recalculate the sign of 2−3; if zero is at the bottom and negative points vanish, expand the vertical range. No automatic fitting or physical-device test is claimed.

## Related guides and sources

[Least-squares residual segments](<https://allluckly.cn/en/guides/vectorpaint-four-point-least-squares-vertical-residual-ledger/>); [Paired-value scatterplot](<https://allluckly.cn/en/guides/vectorpaint-paired-value-scatterplot/>); [Positive and negative bars](<https://allluckly.cn/en/guides/vectorpaint-diverging-bar-chart-negative-positive-zero/>).

Checked 26 November 2026: [OpenStax regression and residuals](<https://openstax.org/books/principles-data-science/pages/4-3-correlation-and-linear-regression-analysis>); [Apple public lookup](<https://itunes.apple.com/lookup?id=1587272880&country=cn>).

