Skip to content

Commit 3e39c0f

Browse files
committed
Update CHANGELOG
1 parent fa4ff7c commit 3e39c0f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,22 @@ Plot’s [axes](./README.md#axis) and [grids](./README.md#axis) are now proper m
4242

4343
TODO Add a bunch of examples (see [Plot: Axes](https://observablehq.com/@observablehq/plot-axes)) that demonstrate some of the new configuration possibilities with axes, including: white grid lines overlaying marks, perhaps ggplot2-style; multi-line tick labels; repeated _both_ axes; and NYT-style dashed grid lines.
4444

45-
[TK image]
45+
The *x* and *y* axes are now automatically repeated in empty facets, improving readability by reducing eye travel to read tick values. Below, note that the *x* axis for culmen depth (with ticks at 15 and 20 mm) is rendered below the Adelie/null-sex facet in the top-right.
46+
47+
[<img src="./img/facet-axes.webp" width="640" alt="A scatterplot showing the culmen length and depth of various penguins, faceted by species and sex; the facets are arranged in a grid, with the y-axis on the left and the x-axis on the bottom.">](https://observablehq.com/@observablehq/plot-axes)
4648

47-
The *x* and *y* axes are now automatically repeated when there are empty facets, improving readability.
49+
```js
50+
Plot.plot({
51+
facet: {marginRight: 80},
52+
marks: [
53+
Plot.dot(penguins, {x: "culmen_depth_mm", y: "culmen_length_mm", stroke: "#ddd"}),
54+
Plot.frame(),
55+
Plot.gridX(),
56+
Plot.gridY(),
57+
Plot.dot(penguins, {x: "culmen_depth_mm", y: "culmen_length_mm", fx: "sex", fy: "species"})
58+
]
59+
})
60+
```
4861

4962
Marks can now declare default margins via the **marginTop**, **marginRight**, **marginBottom**, and **marginLeft** options, and the **margin** shorthand. For each side, the maximum corresponding margin across marks becomes the plot’s default. While most marks default to zero margins (because they are drawn inside the chart area), Plot‘s axis mark provides default margins depending on their anchor. The facet margin options (*e.g.*., facet.**marginRight**) now correctly affect the positioning of the *x* and *y* axis labels.
5063

img/facet-axes.webp

76.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)