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
@@ -723,7 +723,7 @@ The **transform** option allows you to apply a function to all values before the
723
723
```js
724
724
Plot.plot({
725
725
y: {
726
-
label:"↑ Temperature (°F)",
726
+
label:"Temperature (°F)",
727
727
transform: (f) => f *9/5+32// convert Celsius to Fahrenheit
728
728
},
729
729
marks: …
@@ -935,24 +935,28 @@ For a *band* scale, you can further fine-tune padding:
935
935
936
936
Align defaults to 0.5 (centered). Band scale padding defaults to 0.1 (10% of available space reserved for separating bands), while point scale padding defaults to 0.5 (the gap between the first point and the edge is half the distance of the gap between points, and likewise for the gap between the last point and the opposite edge). Note that rounding and mark insets (e.g., for bars and rects) also affect separation between adjacent marks.
937
937
938
-
Plot automatically generates [axis](../marks/axis.md)and optionally [grid](../marks/grid.md) marks for position scales. (For more control, declare these marks explicitly.) You can configure the implicit axes with the following scale options:
938
+
Plot implicitly generates an [axis mark](../marks/axis.md)for position scales if one is not explicitly declared. (For more control, declare the axis mark explicitly.) The following [axis mark options](../marks/axis.md#axis-options) are also available as scale options, applying to the implicit axis:
939
939
940
-
***axis** - *top* or *bottom* (or *both*) for *x*and*fx*; *left* or *right* (or *both*) for *y* and *fy*; null to suppress
940
+
***axis** - the axis **anchor**: *top*, *bottom* (*x*or*fx*); *left*, *right* (*y* or *fy*); *both*; null to suppress
941
941
***ticks** - the approximate number of ticks to generate, or interval, or array of values
942
-
***tickSize** - the length of each tick (in pixels; default 6 for *x* and *y*, or 0 for *fx* and *fy*)
943
942
***tickSpacing** - the approximate number of pixels between ticks (if **ticks** is not specified)
943
+
***tickSize** - the length of each tick (in pixels; default 6 for *x* and *y*, or 0 for *fx* and *fy*)
944
944
***tickPadding** - the separation between the tick and its label (in pixels; default 3)
945
945
***tickFormat** - either a function or specifier string to format tick values; see [Formats](./formats.md)
946
946
***tickRotate** - whether to rotate tick labels (an angle in degrees clockwise; default 0)
947
-
***grid** - whether to draw grid lines across the plot for each tick
948
-
***line** - if true, draw the axis line (only for *x* and *y*)
947
+
***fontVariant** - the font-variant attribute for ticks; defaults to *tabular-nums* if quantitative
949
948
***label** - a string to label the axis
950
949
***labelAnchor** - the label anchor: *top*, *right*, *bottom*, *left*, or *center*
950
+
***labelArrow** - the label arrow: *auto* (default), *up*, *right*, *down*, *left*, *none*, or true
951
951
***labelOffset** - the label position offset (in pixels; default depends on margins and orientation)
952
-
***fontVariant** - the font-variant attribute for ticks; defaults to *tabular-nums* if quantitative
953
952
***ariaLabel** - a short label representing the axis in the accessibility tree
954
953
***ariaDescription** - a textual description for the axis
955
954
955
+
For an implicit [grid mark](../marks/grid.md), use the **grid** option. For an implicit [frame mark](../marks/frame.md) along one edge of the frame, use the **line** option.
956
+
957
+
***grid** - whether to draw grid lines across the plot for each tick
958
+
***line** - if true, draw the axis line (only for *x* and *y*)
959
+
956
960
Top-level options are also supported as shorthand: **grid** (for *x* and *y* only; see [facets](./facets.md)), **label**, **axis**, **inset**, **round**, **align**, and **padding**. If the **grid** option is true, show a grid using *currentColor*; if specified as a string, show a grid with the specified color; if an approximate number of ticks, an interval, or an array of tick values, show corresponding grid lines.
@@ -349,20 +349,23 @@ Note that when an axis mark is declared explicitly (via the [**marks** plot opti
349
349
350
350
In addition to the [standard mark options](../features/marks.md), the axis mark supports the following options:
351
351
352
-
***anchor** - the orientation: *top*, *bottom*(*x* or *fx*); *left*, *right*(*y* or *fy*); *both*; null to suppress
352
+
***anchor** - the axis orientation: *top* or *bottom*for *x* or *fx*; *left* or *right*for *y* or *fy*
353
353
***tickSize** - the length of the tick vector (in pixels; default 6 for *x* or *y*, or 0 for *fx* or *fy*)
354
354
***tickPadding** - the separation between the tick vector and its label (in pixels; default 3)
355
355
***tickFormat** - either a function or specifier string to format tick values; see [Formats](../features/formats.md)
356
356
***tickRotate** - whether to rotate tick labels (an angle in degrees clockwise; default 0)
357
-
***fontVariant** - the font-variant attribute for ticks; defaults to tabular-nums for quantitative axes
357
+
***fontVariant** - the ticks’ font-variant; defaults to *tabular-nums* for quantitative axes
358
358
***label** - a string to label the axis; defaults to the scale’s label, perhaps with an arrow
359
359
***labelAnchor** - the label anchor: *top*, *right*, *bottom*, *left*, or *center*
360
+
***labelArrow** - the label arrow: *auto* (default), *up*, *right*, *down*, *left*, *none*, or true
360
361
***labelOffset** - the label position offset (in pixels; default depends on margins and orientation)
361
362
***color** - the color of the ticks and labels (defaults to *currentColor*)
362
363
***textStroke** - the color of the stroke around tick labels (defaults to *none*)
363
364
***textStrokeOpacity** - the opacity of the stroke around tick labels
364
365
***textStrokeWidth** - the thickness of the stroke around tick labels (in pixels)
365
366
367
+
The **labelArrow** option controls the arrow (↑, →, ↓, or ←) added to the axis label indicating the direction of ascending value; for example, horizontal position *x* typically increases in value going right→, while vertical position *y* typically increases in value going up↑. If *auto* (the default), the arrow will be added only if the scale is quantitative or temporal; if true, the arrow will also apply to ordinal scales, provided the domain is consistently ordered.
368
+
366
369
As a composite mark, the **stroke** option affects the color of the tick vector, while the **fill** option affects the color the text labels; both default to the **color** option, which defaults to *currentColor*. The **x** and **y** channels, if specified, position the ticks; if not specified, the tick positions depend on the axis **anchor**. The orientation of the tick labels likewise depends on the **anchor**. See the [text mark](./text.md) for details on available options for the tick and axis labels.
367
370
368
371
The axis mark’s [**facetAnchor**](../features/facets.md) option defaults to *top-empty* if anchor is *top*, *right-empty* if anchor is *right*, *bottom-empty* if anchor is *bottom*, and *left-empty* if anchor is *left*. This ensures the proper positioning of the axes with respect to empty facets.
0 commit comments