contour

contourNode

A two-variable expression drawn as its level sets. The expression is in x AND y ((x - 2)^2 + (y - 3)^2), grid-sampled over the visible window and traced where it takes equal values, so panning re-samples the surface and a parameter in the expression moves the level sets live. y is the vertical axis here, not a parameter: only the letters beyond x and y get footer sliders.

Only withxyargandpolarplane

#Attributes

expressionRequiredImplicitAnimatable
Also written: exp, f, func, functionMath expression for the surface's value at (x, y). Free letters beyond x and y are parameters.Can be written as shorthand: contour:value
levelsAnimatable
How many level sets to draw — resolved to round values of the expression, the way axis ticks are chosen.
Default12
Also written: values, level-valuesThe exact level values, overriding levels:, for surfaces whose structure even spacing misrepresents — a quadratic bowl wants 1, 4, 9, 16. Entries are parametised: at: k, 2 * k, 4 * k rides a parameter slider.
colourAnimatable
neutralredorangeyellowgreentealbluepurplepinkgreywhiteblackmulticolourtemperature
Also written: colormulticolour (the default) strokes each level along the full spectrum by its own value, violet low to red high; temperature is the blue → white → red ramp; any ordinary hue draws every ring alike. Both ramps are fixed colours, identical in light and dark mode.
Defaultmulticolour
widthAnimatable
Stroke width.
Default1.5
opacityAnimatable
How heavy the lines sit over the marks beneath them.
Default1
hiddenAnimatable
Declared but not drawn — animatable, so hidden: true !cue.to{false}(at: 2) is its reveal.
Defaultfalse
Also written: lockedA reader may not edit it on an editable graph.
Defaultfalse
layerAnimatable
Paint order among the marks: a higher layer is drawn later, on top; equal or omitted, the marks stack in document order (later on top). Written z: before the argand plane took that letter for its coordinate.

#Derived attributes

Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.

minDerived
The smallest value the surface takes over the sampled window — for a loss surface, the number the whole picture is about. Cite it with {{#id.min}}.
maxDerived
The largest value the surface takes over the sampled window.

#Allowed in

#Examples

contour(expression: (x - 2)^2 + (y - 3)^2; levels: 8)
contour(expression: x^2 - y^2; at: -4, -1, 0, 1, 4; colour: teal)
contour(expression: (x - a)^2 + (y - b)^2; levels: 10; opacity: 0.7)
contour(expression: x^2 + y^2; at: k, 2 * k, 4 * k, 8 * k)
contour(expression: sin(x) * cos(y); levels: 14; colour: temperature)