Skip to content

Properties

Properties style the statement they trail: @ color: RED, lineWidth: 4 inline, or @{ … } with one to a line. A property that is true or false may be written bare, as a flag: @ hidden. They are written the same way in a style, which is how a set of them is named and reused with use:.

Which properties are allowed depends on what they trail:

PlacementTakes
an expressionuse, color, suppressTextOutline, lineStyle, lineWidth, lineOpacity, pointStyle, pointSize, movablePointSize, pointOpacity, fillOpacity, hidden, secret, points, lines, fill, label, showLabel, labelSize, labelOrientation, labelAngle, interactiveLabel, editableLabelMode, displayEvaluationAsFraction, showAngleLabel, disableGraphInteractions, cdf, residuals, logMode, binAlignment, histogramMode, dotplotXMode, alignedAxis, axisOffset, breadth, showBoxplotOutliers, pointOutline, dragMode, playing, onClick, clickable, description, slider, loopMode, playDirection, animationPeriod, domain, parametricDomain, polarDomain
a folderhidden, secret, inFrontOfEverything, collapsed
a tableuse, color, lineStyle, lineWidth, lineOpacity, pointStyle, pointSize, movablePointSize, pointOpacity, hidden, points, lines, dragMode
a table columnuse, color, lineStyle, lineWidth, lineOpacity, pointStyle, pointSize, movablePointSize, pointOpacity, hidden, points, lines, dragMode
an imagehidden, secret, disableGraphInteractions, dragMode, onClick, clickable, name, center, width, height, angle, opacity, foreground
the tickerminStep, playing, open
an importhidden, secret, inFrontOfEverything, collapsed
a notesecret
a styleuse, color, suppressTextOutline, lineStyle, lineWidth, lineOpacity, pointStyle, pointSize, movablePointSize, pointOpacity, fillOpacity, hidden, secret, points, lines, fill, label, showLabel, labelSize, labelOrientation, labelAngle, interactiveLabel, editableLabelMode, displayEvaluationAsFraction, showAngleLabel, disableGraphInteractions, cdf, logMode, binAlignment, histogramMode, dotplotXMode, alignedAxis, axisOffset, breadth, showBoxplotOutliers, pointOutline, dragMode, playing, onClick, clickable, description, slider, loopMode, playDirection, animationPeriod, domain, parametricDomain, polarDomain

Apply a style, e.g. use: emphasis. Repeatable; applied in order, and the clause’s own properties win

Takes the name of a style. Written on an expression, a table, a table column or a style. May be given more than once.

Styles apply in the order written, and a property written on the statement itself wins over every style.

style thick { lineWidth: 5; lineStyle: DASHED }
y = sin(x) @ use: thick, color: RED
Open in playground →

Colour: #hex, a palette name (RED, BLUE, GREEN, PURPLE, ORANGE, BLACK), or any expression such as rgb(255, 0, 0) [default: cycles]

Takes a colour: a #hex, a palette name, or an expression. Written on an expression, a table, a table column or a style.

A palette name is case-sensitive - red would be r·e·d - and any expression that works out a colour may be used.

y = x ^ 2 @ color: RED
y = x ^ 2 + 1 @ color: #2d70b3
y = x ^ 2 + 2 @ color: rgb(200, 100, 0)
Open in playground →

Drop the outline drawn behind a label [default: false]

Takes true or false, or the name alone for true. Written on an expression or a style.

(1, 2) @ label: "P", showLabel, suppressTextOutline
Open in playground →

Line style [default: SOLID]

Takes one of its values. Values SOLID, DASHED, DOTTED. Written on an expression, a table, a table column or a style.

y = sin(x) @ lineStyle: DASHED
Open in playground →

Line width in pixels [default: 2.5]

Takes any expression. Written on an expression, a table, a table column or a style.

y = cos(x) @ lineWidth: 5
Open in playground →

Line opacity 0-1 [default: 0.9]

Takes any expression. Written on an expression, a table, a table column or a style.

y = cos(x) @ lineOpacity: 0.3
Open in playground →

Point style [default: POINT]

Takes one of its values. Values POINT, OPEN, CROSS, SQUARE, PLUS, TRIANGLE, DIAMOND, STAR. Written on an expression, a table, a table column or a style.

(1, 1) @ pointStyle: STAR, pointSize: 16
Open in playground →

Point diameter in pixels [default: 9]

Takes any expression. Written on an expression, a table, a table column or a style.

(1, 1) @ pointSize: 20
Open in playground →

Point diameter in pixels while the point is draggable [default: matches pointSize]

Takes any expression. Written on an expression, a table, a table column or a style.

a = 1
(a, 2) @ movablePointSize: 16
Open in playground →

Point opacity 0-1 [default: 0.9]

Takes any expression. Written on an expression, a table, a table column or a style.

(1, 1) @ pointOpacity: 0.4
Open in playground →

Fill opacity 0-1 [default: 0.4]

Takes any expression. Written on an expression or a style.

polygon((0, 0), (2, 0), (1, 2)) @ fillOpacity: 0.7
Open in playground →

Hide graph [default: false]

Takes true or false, or the name alone for true. Written on an expression, a folder, a table, a table column, an image, an import or a style.

The statement still defines what it defines; it is only not drawn.

f(x) = x ^ 2 @ hidden
y = f(x) + 1
Open in playground →

Hide from the expression list, for authors [default: false]

Takes true or false, or the name alone for true. Written on an expression, a folder, an image, an import, a note or a style.

Hidden from anyone reading the expression list, not from the author.

k = 3 @ secret
y = k sin(x)
Open in playground →

Show points [default: true]

Takes true or false, or the name alone for true. Written on an expression, a table, a table column or a style.

[(0, 0), (1, 2), (2, 1)] @ lines, points: false
Open in playground →

Show lines [default: true]

Takes true or false, or the name alone for true. Written on an expression, a table, a table column or a style.

A list of points draws only the points unless it says lines.

[(0, 0), (1, 2), (2, 1)] @ lines
Open in playground →

Fill region [default: false]

Takes true or false, or the name alone for true. Written on an expression or a style.

(cos(t), sin(t)) @ fill, domain: 0..tau
Open in playground →

Point label text [default: empty]

Takes a string. Written on an expression or a style.

P = (2, 1) @ label: "P", showLabel
Open in playground →

Show label [default: false]

Takes true or false, or the name alone for true. Written on an expression or a style.

P = (2, 1) @ label: "P", showLabel
Open in playground →

Label size multiplier [default: 1]

Takes any expression. Written on an expression or a style.

(2, 1) @ label: "big", showLabel, labelSize: 2
Open in playground →

Label position [default: default]

Takes one of its values. Values default, above, below, left, right, above_left, above_right, below_left, below_right. Written on an expression or a style.

(2, 1) @ label: "above", showLabel, labelOrientation: above
Open in playground →

Turn the label by an angle [default: 0]

Takes any expression. Written on an expression or a style.

Counter-clockwise, in radians unless config { degreeMode: true } says degrees.

(2, 1) @ label: "tilted", showLabel, labelAngle: pi / 4
Open in playground →

Show the label only when the point is hovered or clicked [default: false]

Takes true or false, or the name alone for true. Written on an expression or a style.

Desmos switches it off on a point that can be dragged, so it goes with dragMode: none on a movable point.

(2, 1) @ label: "hidden until clicked", showLabel, interactiveLabel
Open in playground →

Let the viewer edit the label in place, as math or as text [default: NONE]

Takes one of its values. Values NONE, MATH, TEXT. Written on an expression or a style.

A MATH label is edited as an expression and a TEXT one as words; either is typed into on the graph itself.

P = (2, 1) @ label: "edit me", showLabel, editableLabelMode: TEXT
Open in playground →

Show the expression’s value as a fraction [default: false]

Takes true or false, or the name alone for true. Written on an expression or a style.

a = 1 / 3 @ displayEvaluationAsFraction
Open in playground →

Show a geometry angle’s measure [default: true]

Takes true or false, or the name alone for true. Written on an expression or a style.

config { calculator: GEOMETRY }
a = angle((1, 0), (0, 0), (0, 1)) @ showAngleLabel: false
Open in playground →

Let the graph be clicked and dragged through this, as though it were not there [default: false]

Takes true or false, or the name alone for true. Written on an expression, an image or a style.

For a point that should not be dragged, a picture laid over the graph, a label that should not catch the pointer.

P = (1, 2) @ disableGraphInteractions
Open in playground →

Shade a distribution’s probability between two bounds

Takes a range, lo..hi step s soft. Written on an expression or a style.

Either end may be left off: cdf: ..1 shades everything up to 1. The probability is shown beside the distribution.

normaldist(0, 1) @ cdf: -1..1
Open in playground →

The list a regression’s residuals are kept in

Takes undefined. Written on an expression.

A name, such as e1. Desmos names one for every regression that does not say, e_1 and up.

xs = [1, 2, 3, 4]
ys = [2.1, 3.9, 6.2, 7.8]
ys ~ m xs + b @ residuals: e1
total(e1 ^ 2)
Open in playground →

Fit a regression in log space [default: false]

Takes true or false, or the name alone for true. Written on an expression or a style.

For an exponential or a power model: the fit minimises the error in the logarithms, which is often what the data calls for. config { forceLogModeRegressions } does it for every regression.

xs = [1, 2, 3, 4]
ys = [2, 4.1, 7.9, 16.2]
ys ~ a b ^ xs @ logMode
Open in playground →

Where a histogram’s or a dot plot’s bins start [default: center]

Takes one of its values. Values center, left. Written on an expression or a style.

center puts a bin around each multiple of the width; left starts one at each.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
histogram(L, 2) @ binAlignment: left
Open in playground →

What a histogram’s bars measure [default: count]

Takes one of its values. Values count, relative, density. Written on an expression or a style.

count is how many values fall in each bin, relative the fraction of them, and density the fraction per unit of width, so the bars have area 1.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
histogram(L, 2) @ histogramMode: density
Open in playground →

Whether a dot plot stacks a dot at its value or at its bin [default: exact]

Takes one of its values. Values exact, bin. Written on an expression or a style.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
dotplot(L, 2) @ dotplotXMode: bin
Open in playground →

The axis a box plot is drawn along [default: x]

Takes one of its values. Values x, y. Written on an expression or a style.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
boxplot(L) @ alignedAxis: y
Open in playground →

How far from its axis a box plot is drawn

Takes any expression. Written on an expression or a style.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
boxplot(L) @ axisOffset: 2
Open in playground →

How thick a box plot is, across the axis it runs along [default: 1]

Takes any expression. Written on an expression or a style.

L = [3, 5, 5, 6, 8, 9, 9, 9, 12]
boxplot(L) @ breadth: 0.5
Open in playground →

Draw a box plot’s outliers as dots beyond its whiskers [default: true]

Takes true or false, or the name alone for true. Written on an expression or a style.

Off, the whiskers run to the least and greatest values.

L = [1, 5, 5, 6, 8, 9, 9, 9, 30]
boxplot(L) @ showBoxplotOutliers: false
Open in playground →

Ring each point in the background colour [default: false]

Takes true or false, or the name alone for true. Written on an expression or a style.

(1, 1) @ pointOutline, pointSize: 16
Open in playground →

Drag mode [default: AUTO]

Takes one of its values. Values AUTO, X, Y, XY, NONE. Written on an expression, a table, a table column, an image or a style.

X and Y let a point move along one axis only; NONE pins it. On an image, any mode but NONE makes it draggable.

P = (1, 2) @ dragMode: X
Open in playground →

Animate slider [default: false]

Takes true or false, or the name alone for true. Written on an expression, the ticker or a style.

a = 1 @ slider: 0..5, playing
y = a sin(x)
Open in playground →

Action run when the object is clicked, e.g. onClick: a -> a + 1 or a run a -> 1, b -> 2

Takes an action or a run of them. Written on an expression, an image or a style.

An action, target -> value, or a run of them separated by commas, which happen together. The comma after the run starts the next property only when an identifier: follows it.

n = 0
(n, 0) @ onClick: n -> n + 1, pointSize: 20
Open in playground →

Enable/disable the onClick action [default: true when onClick is set]

Takes true or false, or the name alone for true. Written on an expression, an image or a style.

n = 0
(0, 0) @ onClick: n -> n + 1, clickable: false
Open in playground →

Screen-reader description, shown for clickable objects

Takes a string. Written on an expression or a style.

n = 0
(0, 0) @ onClick: n -> n + 1, description: "Count up"
Open in playground →

Slider range for a defined value, e.g. slider: -5..5 step 0.5. Both ends are limits unless soft, soft min or soft max says otherwise, and either end may be left out to keep Desmos’ own

Takes a range, lo..hi step s soft. Written on an expression or a style.

A stepped slider snaps its value to the step’s grid, counted from its min.

a = 2 @ slider: 0..10 step 0.5
b = 1 @ slider: 0.. soft
y = a x + b
Open in playground →

What an animating slider does at the end of its range [default: LOOP_FORWARD_REVERSE]

Takes one of its values. Values LOOP_FORWARD_REVERSE, LOOP_FORWARD, PLAY_ONCE, PLAY_INDEFINITELY. Written on an expression or a style.

a = 0 @ slider: 0..5, playing, loopMode: LOOP_FORWARD
Open in playground →

Which way an animating slider runs: 1 forwards, -1 backwards [default: 1]

Takes a number. Written on an expression or a style.

a = 5 @ slider: 0..5, playing, playDirection: -1
Open in playground →

How long one sweep of an animating slider takes, in milliseconds [default: 8000]

Takes a number. Written on an expression or a style.

a = 0 @ slider: 0..10, playing, animationPeriod: 2000
Open in playground →

The range a parametric or polar curve is drawn over, e.g. domain: 0..2pi

Takes a range, lo..hi step s soft. Written on an expression or a style.

A parametric curve given no domain runs t over [0, 1], not a whole period.

(cos(t), sin(2t)) @ domain: 0..tau
Open in playground →

The older copy of domain Desmos writes beside it, for a graph whose two disagree

Takes a range, lo..hi step s soft. Written on an expression or a style.

(t, t ^ 2) @ parametricDomain: -2..2
Open in playground →

The range a polar curve is drawn over in polar mode, e.g. polarDomain: 0..2pi

Takes a range, lo..hi step s soft. Written on an expression or a style.

r = theta / 4 @ polarDomain: 0..6pi
Open in playground →

The caption an image carries in the expression list

Takes a string. Written on an image.

image "./images/wave.png" @ name: "A wave"
Open in playground →

The point an image is centred on, e.g. center: (0, 0)

Takes any expression. Written on an image.

image "./images/wave.png" @ center: (2, 3)
Open in playground →

How wide an image is drawn, in graph units

Takes any expression. Written on an image.

image "./images/wave.png" @ width: 8
Open in playground →

How tall an image is drawn, in graph units

Takes any expression. Written on an image.

image "./images/wave.png" @ height: 4
Open in playground →

How far an image is rotated, anticlockwise, in radians

Takes any expression. Written on an image.

image "./images/wave.png" @ angle: pi / 6
Open in playground →

Image opacity 0-1 [default: 1]

Takes any expression. Written on an image.

image "./images/wave.png" @ opacity: 0.5
Open in playground →

Draw an image over the graph rather than under it [default: false]

Takes true or false, or the name alone for true. Written on an image.

image "./images/wave.png" @ foreground
y = sin(x)
Open in playground →

Draw what the folder holds over everything else [default: false]

Takes true or false, or the name alone for true. Written on a folder or an import.

folder "Border" { @ inFrontOfEverything
y = x @ lineWidth: 8
}
y < x
Open in playground →

Start a folder collapsed [default: false; an import starts collapsed]

Takes true or false, or the name alone for true. Written on a folder or an import.

folder "Waves" { @ collapsed
y = sin(x)
y = cos(x)
}
Open in playground →

The ticker statement takes a list of its own. Its playing is not a slider’s: it starts the ticker rather than an animation.

Shortest gap between ticks, in milliseconds, 0 for every frame [default: 0]

Takes any expression. Written on the ticker.

n = 0
ticker n -> n + 1 @ minStep: 100, playing
Open in playground →

Start the ticker running when the graph opens [default: false]

Takes true or false, or the name alone for true. Written on the ticker.

t = 0
ticker t -> t + dt / 1000 @ playing
y = sin(x - t)
Open in playground →

Show the ticker expanded in the expression list [default: false]

Takes true or false, or the name alone for true. Written on the ticker.

n = 0
ticker n -> n + 1 @ open
Open in playground →

The colours Desmos names, which color: takes by name. The names are case-sensitive: red is the product r·e·d.

NameColour
RED #c74440
BLUE #2d70b3
GREEN #388c46
PURPLE #6042a6
ORANGE #fa7e19
BLACK #000000