Command: plot/draw-grid

The plot/draw-grid element draws a background grid.

Syntax

(plot/draw-grid <options>)
(plot/draw-grid 
tick-placement-x (...)
tick-placement-y (...)
stroke-style (...)
stroke-width (...)
stroke-color (...)
color (...)
scale-x (...)
scale-y (...)
limit-x (...)
limit-x-min (...)
limit-x-max (...)
limit-y (...)
limit-y-min (...)
limit-y-max (...))

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-style

Set the grid's stroke style.

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

stroke-width

Set the grid's stroke width.

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

stroke-color

Set the grid's stroke color.

stroke-color <color>
Examples:
;; set the color to grey
stroke-color #eee

;; set the color to red, 50% transparent
stroke-color (rgba 1 0 0 .5)

color

Alias for the stroke-color option.

scale-x

Set the type of the 'x' (horizontal) scale.

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 the scale to logarithmic mode
scale-x (log)

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

scale-y

Set the type of the 'y' (vertical) scale.

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 the scale to logarithmic mode
scale-y (log)

;; set the scale to inverted mode
scale-y (invert)

limit-x

Set the limits (minimum and maximum values) for the 'x' (horizontal) scale.

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

limit-x-min

Set the minimum value (lower limit) for the 'x' (horizontal) scale.

limit-x-min <min>
Examples:
;; set the lower limit to 2
limit-x-min 2

limit-x-max

Set the maximum value (upper limit) for the 'x' (horizontal) scale.

limit-y

Set the limits (minimum and maximum values) for the 'y' (vertical) scale.

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

limit-y-min

Set the minimum value (lower limit) for the 'y' (vertical) scale.

limit-y-min <min>
Examples:
;; set the lower limit to 2
limit-y-min 2

limit-y-max

Set the maximum value (upper limit) for the 'y' (vertical) scale.

Examples

Edit this page on GitHub