|
4 | 4 |
|
5 | 5 | *Not yet released. These are forthcoming changes in the main branch.*
|
6 | 6 |
|
7 |
| -The new density mark creates density contours. |
| 7 | +The new density mark creates contours representing the [estimated density](https://en.wikipedia.org/wiki/Multivariate_kernel_density_estimation) of point clouds. |
8 | 8 |
|
9 |
| -The new linear regression marks produce linear regressions with confidence interval bands. |
| 9 | +[<img src="./img/density-contours.png" width="640" height="400" alt="A scatterplot showing the relationship between the idle duration and eruption duration for Old Faithful">](https://observablehq.com/@observablehq/plot-density) |
| 10 | + |
| 11 | +```js |
| 12 | +Plot.plot({ |
| 13 | + inset: 20, |
| 14 | + marks: [ |
| 15 | + Plot.density(faithful, {x: "waiting", y: "eruptions", stroke: "steelblue", strokeWidth: 0.25}), |
| 16 | + Plot.density(faithful, {x: "waiting", y: "eruptions", thresholds: 4, stroke: "steelblue"}), |
| 17 | + Plot.dot(faithful, {x: "waiting", y: "eruptions", fill: "currentColor", r: 1.5}) |
| 18 | + ] |
| 19 | +}) |
| 20 | +``` |
| 21 | + |
| 22 | +The new linear regression marks produce [linear regressions](https://en.wikipedia.org/wiki/Linear_regression) with [confidence interval](https://en.wikipedia.org/wiki/Confidence_interval) bands, representing the estimated relation of a dependent variable (typically *y*) on an independent variable (typically *x*). |
| 23 | + |
| 24 | +[<img src="./img/linear-regression.png" width="640" height="400" alt="a scatterplot of penguin culmens, showing the length and depth of several species, with linear regression models by species and for the whole population, illustrating Simpson’s paradox">](https://observablehq.com/@observablehq/plot-linear-regression) |
| 25 | + |
| 26 | +```js |
| 27 | +Plot.plot({ |
| 28 | + grid: true, |
| 29 | + marks: [ |
| 30 | + Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", fill: "species"}), |
| 31 | + Plot.linearRegressionY(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", stroke: "species"}), |
| 32 | + Plot.linearRegressionY(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm"}) |
| 33 | + ] |
| 34 | +}) |
| 35 | +``` |
10 | 36 |
|
11 | 37 | The new Delaunay marks produce Delaunay triangulations. Plot.delaunayLink, Plot.delaunayMesh, and Plot.hull.
|
12 | 38 |
|
|
0 commit comments