Skip to content

Commit 58d0702

Browse files
committed
Update README
1 parent 94aa8c3 commit 58d0702

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,14 @@ Plot.plot({
213213

214214
#### *plot*.scale(*scaleName*)
215215

216-
Scale definitions can be exposed through the *plot*.**scale**(*scaleName*) function of a returned plot. The *scaleName* must be one of the known scale names: `"x"`, `"y"`, `"fx"`, `"fy"`, `"r"`, `"color"`, `"opacity"`, `"symbol"`, or `"length"`.
216+
Scale definitions can be exposed through the *plot*.**scale**(*scaleName*) function of a returned plot. The *scaleName* must be one of the known scale names: `"x"`, `"y"`, `"fx"`, `"fy"`, `"r"`, `"color"`, `"opacity"`, `"symbol"`, or `"length"`. If the associated *plot* has no scale with the given *scaleName*, returns undefined.
217217

218218
```js
219219
const plot = Plot.plot(…); // render a plot
220220
const color = plot.scale("color"); // retrieve the color scale object
221221
console.log(color.range); // inspect the color scale’s range, ["red", "blue"]
222222
```
223223

224-
If the associated *plot* has no scale with the given *scaleName*, returns undefined.
225-
226224
#### Plot.scale(*options*)
227225

228226
You can also create a standalone scale with Plot.**scale**(*options*). The *options* object must define at least one scale; see [Scale options](#scale-options) for how to define a scale. For example, here is a linear color scale with the default domain of [0, 1] and default scheme *turbo*:

0 commit comments

Comments
 (0)