Skip to content

Commit 0d32fac

Browse files
authored
document the default height
see #337 and https://observablehq.com/d/f7ce87cd798d9674
1 parent 0c291ed commit 0d32fac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ These options determine the overall layout of the plot; all are specified as num
8181
* **width** - the outer width of the plot (including margins)
8282
* **height** - the outer height of the plot (including margins)
8383

84-
The default **width** is 640. On Observable, the width can be set to the [standard width](https://github.com/observablehq/stdlib/blob/master/README.md#width) to make responsive plots. The default **height** is 396 if the plot has a *y* or *fy* scale; otherwise it is 90 if the plot has an *fx* scale, or 60 if it does not. (The default height will be getting smarter for ordinal domains; see [#337](https://github.com/observablehq/plot/pull/337).)
84+
The default **width** is 640. On Observable, the width can be set to the [standard width](https://github.com/observablehq/stdlib/blob/master/README.md#width) to make responsive plots. The default **height** is 400 if the plot has a continuous *y* scale and no *fy* scale; otherwise, it is 90 if the plot has an *fx* scale, and 60 if it hasn’t, to which a heuristic value is added that takes into account the number of categories if the plot has an ordinal *y* scale, as well as the number of facets if the plot has a *fy* scale.
8585

8686
The default margins depend on the plot’s axes: for example, **marginTop** and **marginBottom** are at least 30 if there is a corresponding top or bottom *x* axis, and **marginLeft** and **marginRight** are at least 40 if there is a corresponding left or right *y* axis. For simplicity’s sake and for consistent layout across plots, margins are not automatically sized to make room for tick labels; instead, shorten your tick labels or increase the margins as needed. (In the future, margins may be specified indirectly via a scale property to make it easier to reorient axes without adjusting margins; see [#210](https://github.com/observablehq/plot/issues/210).)
8787

0 commit comments

Comments
 (0)