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:
Expressions, columns and styles
Section titled “Expressions, columns and styles”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: REDColour: #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: REDy = x ^ 2 + 1 @ color: #2d70b3y = x ^ 2 + 2 @ color: rgb(200, 100, 0)suppressTextOutline
Section titled “suppressTextOutline”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, suppressTextOutlinelineStyle
Section titled “lineStyle”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: DASHEDlineWidth
Section titled “lineWidth”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: 5lineOpacity
Section titled “lineOpacity”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.3pointStyle
Section titled “pointStyle”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: 16pointSize
Section titled “pointSize”Point diameter in pixels [default: 9]
Takes any expression. Written on an expression, a table, a table column or a style.
(1, 1) @ pointSize: 20movablePointSize
Section titled “movablePointSize”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: 16pointOpacity
Section titled “pointOpacity”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.4fillOpacity
Section titled “fillOpacity”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.7hidden
Section titled “hidden”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 @ hiddeny = f(x) + 1secret
Section titled “secret”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 @ secrety = k sin(x)points
Section titled “points”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: falseShow 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)] @ linesFill 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..tauPoint label text [default: empty]
Takes a string. Written on an expression or a style.
P = (2, 1) @ label: "P", showLabelshowLabel
Section titled “showLabel”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", showLabellabelSize
Section titled “labelSize”Label size multiplier [default: 1]
Takes any expression. Written on an expression or a style.
(2, 1) @ label: "big", showLabel, labelSize: 2labelOrientation
Section titled “labelOrientation”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: abovelabelAngle
Section titled “labelAngle”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 / 4interactiveLabel
Section titled “interactiveLabel”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, interactiveLabeleditableLabelMode
Section titled “editableLabelMode”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: TEXTdisplayEvaluationAsFraction
Section titled “displayEvaluationAsFraction”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 @ displayEvaluationAsFractionshowAngleLabel
Section titled “showAngleLabel”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: falsedisableGraphInteractions
Section titled “disableGraphInteractions”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) @ disableGraphInteractionsShade 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..1residuals
Section titled “residuals”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: e1total(e1 ^ 2)logMode
Section titled “logMode”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 @ logModebinAlignment
Section titled “binAlignment”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: lefthistogramMode
Section titled “histogramMode”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: densitydotplotXMode
Section titled “dotplotXMode”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: binalignedAxis
Section titled “alignedAxis”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: yaxisOffset
Section titled “axisOffset”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: 2breadth
Section titled “breadth”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.5showBoxplotOutliers
Section titled “showBoxplotOutliers”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: falsepointOutline
Section titled “pointOutline”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: 16dragMode
Section titled “dragMode”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: Xplaying
Section titled “playing”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, playingy = a sin(x)onClick
Section titled “onClick”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: 20clickable
Section titled “clickable”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: falsedescription
Section titled “description”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"slider
Section titled “slider”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.5b = 1 @ slider: 0.. softy = a x + bloopMode
Section titled “loopMode”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_FORWARDplayDirection
Section titled “playDirection”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: -1animationPeriod
Section titled “animationPeriod”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: 2000domain
Section titled “domain”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..tauparametricDomain
Section titled “parametricDomain”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..2polarDomain
Section titled “polarDomain”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..6piImages
Section titled “Images”The caption an image carries in the expression list
Takes a string. Written on an image.
image "./images/wave.png" @ name: "A wave"center
Section titled “center”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)How wide an image is drawn, in graph units
Takes any expression. Written on an image.
image "./images/wave.png" @ width: 8height
Section titled “height”How tall an image is drawn, in graph units
Takes any expression. Written on an image.
image "./images/wave.png" @ height: 4How far an image is rotated, anticlockwise, in radians
Takes any expression. Written on an image.
image "./images/wave.png" @ angle: pi / 6opacity
Section titled “opacity”Image opacity 0-1 [default: 1]
Takes any expression. Written on an image.
image "./images/wave.png" @ opacity: 0.5foreground
Section titled “foreground”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" @ foregroundy = sin(x)Folders and imports
Section titled “Folders and imports”inFrontOfEverything
Section titled “inFrontOfEverything”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 < xcollapsed
Section titled “collapsed”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)}The ticker
Section titled “The ticker”The ticker statement takes a list of its own. Its playing is not a slider’s: it starts the ticker rather than an animation.
minStep
Section titled “minStep”Shortest gap between ticks, in milliseconds, 0 for every frame [default: 0]
Takes any expression. Written on the ticker.
n = 0ticker n -> n + 1 @ minStep: 100, playingplaying
Section titled “playing”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 = 0ticker t -> t + dt / 1000 @ playingy = sin(x - t)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 = 0ticker n -> n + 1 @ openThe palette
Section titled “The palette”The colours Desmos names, which color: takes by name. The names are case-sensitive: red is the product r·e·d.
| Name | Colour |
|---|---|
RED | #c74440 |
BLUE | #2d70b3 |
GREEN | #388c46 |
PURPLE | #6042a6 |
ORANGE | #fa7e19 |
BLACK | #000000 |