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
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,17 @@ The position scales (*x*, *y*, *fx*, and *fy*) support additional options:
225
225
**scale*.**inset** - inset the default range by the specified amount in pixels
226
226
**scale*.**round** - round the output value to the nearest integer (whole pixel)
227
227
228
-
The *scale*.inset option can provide “breathing room” to separate marks from axes or the plot’s edge. For example, in a scatterplot with a Plot.dot with the default 3-pixel radius and 1.5-pixel stroke width, an inset of 5 pixels prevents dots from overlapping with the axes. The *scale*.round option is useful for crisp edges by rounding to the nearest pixel boundary.
228
+
The *x* scale supports asymmetric insets for more precision. Replace inset by:
229
+
230
+
**scale*.**insetLeft** - insets the start of the default range by the specified number of pixels
231
+
**scale*.**insetRight** - insets the end of the default range by the specified number of pixels
232
+
233
+
Similarly, the *y* scale supports asymmetric insets with:
234
+
235
+
**scale*.**insetTop** - insets the top of the default range by the specified number of pixels
236
+
**scale*.**insetBottom** - insets the bottom of the default range by the specified number of pixels
237
+
238
+
The inset scale options can provide “breathing room” to separate marks from axes or the plot’s edge. For example, in a scatterplot with a Plot.dot with the default 3-pixel radius and 1.5-pixel stroke width, an inset of 5 pixels prevents dots from overlapping with the axes. The *scale*.round option is useful for crisp edges by rounding to the nearest pixel boundary.
229
239
230
240
In addition to the generic *ordinal* scale type, which requires an explicit output range value for each input domain value, Plot supports special *point* and *band* scale types for encoding ordinal data as position. These scale types accept a [*min*, *max*] range similar to quantitative scales, and divide this continuous interval into discrete points or bands based on the number of distinct values in the domain (*i.e.*, the domain’s cardinality). If the associated marks have no effective width along the ordinal dimension — such as a dot, rule, or tick — then use a *point* scale; otherwise, say for a bar, use a *band* scale. In the image below, the top *x*-scale is a *point* scale while the bottom *x*-scale is a *band* scale; see [Plot: Scales](https://observablehq.com/@observablehq/plot-scales) for an interactive version.
0 commit comments