You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,7 +236,7 @@ Plot automatically generates axes for position scales. You can configure these a
236
236
**scale*.**labelAnchor** - the label anchor: *top*, *right*, *bottom*, *left*, or *center*
237
237
**scale*.**labelOffset** - the label position offset (in pixels; default 0, typically for facet axes)
238
238
239
-
Plot does not currently generate a legend for the *color*, *radius*, or *opacity* scales, but when it does, we expect that some of the above options will also be used to configure legends. Top-level options are also supported as shorthand: **grid** (for *x* and *y* only; see [facet.grid](#facets)), **inset**, **round**, **align**, and **padding**.
239
+
Plot does not currently generate a legend for the *color*, *radius*, or *opacity* scales, but when it does, we expect that some of the above options will also be used to configure legends. Top-level options are also supported as shorthand: **grid** (for *x* and *y* only; see [facet.grid](#facet-options)), **inset**, **round**, **align**, and **padding**.
240
240
241
241
### Color options
242
242
@@ -349,11 +349,9 @@ Plot.plot({
349
349
})
350
350
```
351
351
352
-
##Facets
352
+
### Facet options
353
353
354
-
[<imgsrc="./img/frame.png"width="320"height="198"alt="a faceted scatterplot with a frame around each facet">](https://observablehq.com/@data-workflows/plot-facets)
355
-
356
-
The *facet* option enables faceting. When faceting, two additional band scales may be configured:
354
+
The *facet* option enables [faceting](https://observablehq.com/@data-workflows/plot-facets). When faceting, two additional band scales may be configured:
357
355
358
356
***fx** - horizontal position
359
357
***fy** - vertical position
@@ -379,15 +377,15 @@ Plot.plot({
379
377
},
380
378
marks: {
381
379
Plot.frame(), // draws a outline around each facet
382
-
Plot.dot(penguins.slice(), {fill:"grey", x: …}), // draws all penguins on each facet
383
-
Plot.dot(penguins, {fill:"blue", x: …}),// draws only the current facet’s subset
380
+
Plot.dot(penguins.slice(), {x:"culmen_length_mm", y:"culmen_depth_mm", fill:"#eee"}), // draws all penguins on each facet
381
+
Plot.dot(penguins, {x:"culmen_length_mm", y:"culmen_depth_mm"})// draws only the current facet’s subset
384
382
}
385
383
})
386
384
```
387
385
388
386
## Marks
389
387
390
-
Marks visualize data as geometric shapes such as bars, dots, and lines. An single mark can generate multiple shapes: for example, passing a [Plot.barY](#plotbarydata-options) to [Plot.plot](#plotplotoptions) will produce a bar for each element in the associated data. Multiple marks can be layered into plots.
388
+
[Marks](https://observablehq.com/@data-workflows/plot-marks) visualize data as geometric shapes such as bars, dots, and lines. An single mark can generate multiple shapes: for example, passing a [Plot.barY](#plotbarydata-options) to [Plot.plot](#plotplotoptions) will produce a bar for each element in the associated data. Multiple marks can be layered into plots.
391
389
392
390
Mark constructors take two arguments: **data** and **options**. Together, the *data* and *options* describe a tabular dataset and how to visualize it. Options that are shared by all of a mark’s generated shapes are known as *constants*, while options that vary with the mark’s data are known as *channels*. Channels are typically specified as abstract values such as time or temperature rather than visual values such as position or color because most channels are bound to [scales](#scale-options).
0 commit comments