Element: plot/grid

The plot/grid element is used to draw a background grid.

Syntax

(plot/grid <options>)

Options

Grid Options

tick-placement-x tick-placement-y stroke stroke-style stroke-width stroke-color color

Scale Options

limit-x limit-x-min limit-x-max limit-y limit-y-min limit-y-max scale-x scale-y scale-x-padding scale-y-padding

Grid Options

tick-placement-x

The 'tick-placement-x' option controls the x grid placement.

tick-placement-x <tick-placement>
Examples:
;; subdivide the axis with 10 tick-placement

tick-placement-y

The 'tick-placement-y' option controls the y grid placement.

tick-placement-y <tick-placement>
Examples:
;; subdivide the axis with 10 tick-placement

stroke

Set the grids's stroke style. See the stroke-style page for more details on valid values.

stroke (<stroke-style>)
Examples:
;; set the stroke to 2px solid
stroke (2px solid)

stroke-style

Set the grid's stroke style. See the stroke-style page for more details on valid values.

stroke (<stroke-style>)
Examples:
;; set the stroke to dashed
stroke-style dashed

stroke-width

Set the grid's stroke width. See the Typographic Units page for more details on valid values.

stroke-width <measure>
Examples:
;; set the stroke width to 2pt
stroke-width 2pt

stroke-color

Set the grid's stroke color.

stroke-color <color>

color

Alias for the stroke-color option.

Scale Options

limit-x

Set the 'x' axis value range to the closed interval [min, max]. If no explicit limits are specified, the limit is set to the smallest interval that contains all input data points.

limit-x (<min> <max)
Examples:
;; set x axis range to [1..10]
limit-x (1 10)

limit-x-min

Set the 'x' axis minimum value. If no explicit minimum is specified, the minimum is set to the smallest value in the input data set.

limit-x-min <min>
Examples:
;; set x axis min value to 2
limit-x-min 2

limit-x-max

Set the 'x' axis maximum value. If no explicit maximm is specified, the maximum is set to the largest value in the input data set.

limit-x-max <max>
Examples:
;; set x axis max value to 20
limit-x-max 20

limit-y

Set the 'y' axis value range to the closed interval [min, max]. If no explicit limits are specified, the limit is set to the smallest interval that contains all input data points.

limit-y (<min> <max)
Examples:
;; set y axis range to [1..10]
limit-y (1 10)

limit-y-min

Set the 'y' axis minimum value. If no explicit minimum is specified, the minimum is set to the smallest value in the input data set.

limit-y-min <min>
Examples:
;; set y axis min value to 2
limit-y-min 2

limit-y-max

Set the 'y' axis maximum value. If no explicit maximm is specified, the maximum is set to the largest value in the input data set.

limit-y-max <max>
Examples:
;; set y axis max value to 20
limit-y-max 20

scale-x

Set the 'x' scale type.

scale-x ([linear] [log] [logarithmic] [invert] [inverted])

List of scale types:

  • linear - Standard linear scale
  • log, logarithmic - Logarithmic (log10) scale
  • invert, inverted - Flip the scale
Examples:
;; set x axis to logarithmic mode
scale-x (log)

;; set x axis to inverted mode
scale-x (invert)

scale-y

Set the 'y' scale type.

scale-y ([linear] [log] [logarithmic] [invert] [inverted])

List of scale types:

  • linear - Standard linear scale
  • log, logarithmic - Logarithmic (log10) scale
  • invert, inverted - Flip the scale
Examples:
;; set x axis to logarithmic mode
scale-y (log)

;; set x axis to inverted mode
scale-y (invert)

scale-x-padding

Set the 'x' scale 'padding'. The scale padding is used to extend the automatically assigned scale limits. The padding option is hence only useful when no explicit limits are specified (using limit-x). The padding is specified in the display unit system of the axis.

scale-x-padding <value>
Examples:
;; set x axis padding to 10
scale-x-padding 10

scale-y-padding

Set the 'y' scale 'padding'. The scale padding is used to extend the automatically assigned scale limits. The padding option is hence only useful when no explicit limits are specified (using limit-y). The padding is specified in the display unit system of the axis.

scale-y-padding <value>
Examples:
;; set y axis padding to 10
scale-y-padding 10
Edit this page on GitHub