Home / DOE / Charts / Contour Plot
Contour Plot¶
A contour plot draws the fitted response over two factors as lines of equal response, the same surface a Surface Plot shows in three dimensions, seen from directly above.
QXL DOE New > Charts > Analysis > Contour Plot
When to use it¶
A contour plot draws lines of equal response on a flat pair of axes, from the same 41 by 41 prediction grid the Surface Plot uses. Because it is flat, nothing is hidden behind a ridge and a region that meets a target reads as a band rather than a slope.
Where the numbers come from¶
This chart is built from a regression sheet only. Design sheets are not offered, because the chart plots a value that only a fitted model can produce.
A chart built from a regression sheet does not re-fit the model. It reads the coefficients already on that sheet and evaluates the prediction equation with them.
Two things follow. The chart always agrees with the sheet it came from, so if you edit a coefficient the next chart changes with it. And a chart is only as current as its regression sheet: change the design and the old charts do not update, because nothing re-runs the regression for them.
A term that is not in the regression table, or that is switched off for the output level being charted, contributes exactly zero to the prediction. It is not an error and there is no warning: the chart is simply drawn from the reduced model. So a chart reflects which terms are active at the moment it is created, and two charts of the same output can differ because the active terms changed between them.
The dialog¶
The dialog is the one the Surface Plot uses. One option does not mean the same thing here: a contour requires both of its axes to be quantitative, where a surface will take a categorical factor on its series axis.
The left side of the dialog is a box headed Outputs holding a tree with three levels: the worksheet, then each output on it, then each level of that output. Tick the levels you want a chart for. The dialog opens with every level on the active sheet already ticked.
The two upper levels are three-state. Ticking a worksheet or an output ticks everything under it, and clearing it clears everything under it. When only some of the children are ticked, the parent shows a partial state rather than a tick, so the tree tells you at a glance whether a selection is complete.
One worksheet at a time. Ticking anything on a second worksheet silently clears every tick on the one you had selected, and the options on the right rebuild for the new sheet. There is no warning and no way to draw charts from two source sheets in one Create.
If you press Create with nothing ticked, the dialog tells you At least one chart must be selected. and stays open.
Chart layout¶
The box headed Chart layout decides how many charts one Create produces.
All factor pairs (grid) lays the ticked factors out as a square grid on one worksheet, with the factor names down the diagonal. Every pair appears twice, once with each factor on the horizontal axis, because the two orders are different charts. So four ticked factors give twelve charts on one sheet, not six. Use it to scan a model.
One specific pair draws a single chart from the two factors you name below, and gives it the whole sheet. Use it once you know which pair you care about.
A grid cell is only drawn when its factors suit the chart. On a surface grid the horizontal factor must be quantitative; on a contour grid both factors must be. A cell that fails the rule is left as NA rather than as a chart, so a model with categorical factors gives a grid with gaps in it.
The box headed Factors to plot carries a checkbox per factor and feeds the grid: the pairs are made from the factors ticked here. It has no effect when you have chosen one specific pair, because the pair is then taken from the two axis pickers instead.
In grid mode you get one worksheet per ticked output level, each holding that level's full grid of pairs. Ticking three levels therefore produces three grid sheets, not one sheet with everything on it.
The axes¶
With one specific pair chosen, Horizontal axis (X) and Series axis (Y) each take a factor, and a quantitative factor also takes a From and to range.
Both axes must be quantitative, and the dialog enforces it by omission. On a contour the Horizontal axis (X) and Series axis (Y) lists offer quantitative factors only, so a categorical factor cannot be put on an axis in the first place. In grid mode a cell whose pair involves a categorical factor is drawn as NA rather than as a contour.
Set points¶
A chart can only vary the factors on its axes. Every other factor in the model has to be held at some value while the chart is drawn, and the box headed Set points (factors held constant) is where you choose those values.
The box is not always on screen. It belongs to a prediction, so:
- With a design sheet as the source it disappears entirely. A design-source chart averages the runs at each setting instead of predicting, so nothing is held constant, and the extrapolation prompt cannot appear either.
- On the Surface, Contour, Trellis and Cube dialogs it also disappears when no factor is being held, which happens when every factor in the model is on an axis.
Which factors get a row differs by dialog. On Surface, Contour, Trellis and Cube a factor's row is hidden while that factor is on an axis, except in grid mode, where every factor keeps a row because each one is held constant in the cells where it is not an axis. On the Interaction, Main Effects and Thumbnail dialog every factor keeps a row, and the rows for the plotted factors have no effect.
The set points are part of the prediction, not decoration. Changing one moves the whole surface, because the fitted model includes that factor and any interactions it appears in. Two charts of the same pair of factors at different set points are two different slices of the same model, and they can look nothing alike when the held factor interacts with an axis factor.
For a quantitative factor the set point is a value. For a categorical factor it is one of its levels.
A set point outside the range the factor took in the data makes the chart an extrapolation, and the software asks before drawing it. Keeping set points inside the observed range keeps the chart inside the region the experiment actually covered.
Before it draws¶
If anything you typed reaches outside the range the factor actually took in the data, the software asks before drawing. A set point is one source of that. On the dialogs that carry axis range boxes, which are Surface Plot, Contour Plot and Trellis, a From or to value counts too, as does a trellis slice range, so widening an axis past the experimental range raises the prompt on its own with every set point left alone. The prompt lists each offending entry with the factor's experimental range beside it, warns that the chart will extrapolate beyond the data, and asks whether to create it anyway. Answering no returns you to the dialog with your options intact.
This is a warning, not a refusal. A prediction outside the range of the data is an extrapolation of the fitted model, and the model was never tested there.
While charts are being written, a status line reports what is happening and a progress bar appears only when more than one chart is being drawn, since a bar for a single chart would sit at 100 percent from the moment it appeared.
Cancel stops the run cleanly between charts, not part way through one. A chart that has already been written stays; the sheet that was mid-write is deleted rather than left half finished. So cancelling never leaves a partial chart behind, but it can leave fewer sheets than you asked for.
What you get¶
A worksheet named Contour Plot - output level name, placed immediately to the right of the regression sheet. In grid mode you get one such sheet per ticked output level.
The sheet name does not distinguish single, grid and trellis contours: all three use that same form. See DOE Charts for the naming rule across the family.
How it is calculated¶
Identically to the surface: each quantitative axis carries 41 evenly spaced values from the From value to the to value inclusive, the model is evaluated at every intersection, and the contour lines are drawn through that grid.
A prediction is the sum, over every term in the model, of that term's coded value times its coefficient:
where \(c_j\) is the coded value of term \(j\) at the settings you asked about and \(b_j\) is its coefficient from the regression table. The constant term has \(c_j = 1\), so its coefficient enters as itself.
A term that is absent from the regression table, or switched off for the level being predicted, contributes \(b_j = 0\).
Full details: Prediction Equation.
Because the grid is 41 points wide rather than continuous, a contour line is a path through grid values rather than an exact solution of the equation. Lines are smooth where the surface changes gently and become visibly angular only where it changes very fast relative to the grid.
See Also¶
- Surface Plot, the same fit in three dimensions
- Trellis
- Chart Source
- Prediction Equation