plot/rectangles

The plot/vectors command takes an input data table, transforms it according to a user-provided scale configuration and then plots the data as tiled rectangles.

Syntax

rectangles (
data-x (...)
data-y (...)
data-x (...)
data-y (...)
size (...)
sizes (...)
size-x (...)
sizes-x (...)
size-y (...)
sizes-y (...)
color (...)
colors (...)
color-map (...)
scale-x (...)
scale-y (...)
limit-x (...)
limit-x-min (...)
limit-x-max (...)
limit-y (...)
limit-y-min (...)
limit-y-max (...))

Options

data-x <>

Set the 'x' dataset for the plot. The 'x' dataset will be used to calculate the horizontal position of the rectangles.

data-x (<values>...)
data-x (csv <file> <column>)
Examples:
;; list of static values
data-x (10px 20px 30px)

;; load a csv file
data-x (csv myfile.csv mycolumn)

data-y <>

Set the 'y' dataset for the plot. The 'y' dataset will be used to calculate the vertical position of the rectangles.

data-y (<values>...)
data-y (csv <file> <column>)
Examples:
;; list of static values
data-y (10px 20px 30px)

;; load a csv file
data-y (csv myfile.csv mycolumn)

data-x <dataset>

Set the 'x' dataset for the plot. The 'x' dataset will be used to calculate the horizontal position of points.

data-x (<values>...)
data-x (csv <file> <column>)
Examples:
;; list of static values
data-x (10px 20px 30px)

;; load a csv file
data-x (csv myfile.csv mycolumn)

data-y <dataset>

Set the 'y' dataset for the plot. The 'y' dataset will be used to calculate the vertical position of points.

data-y (<values>...)
data-y (csv <file> <column>)
Examples:
;; list of static values
data-y (10px 20px 30px)

;; load a csv file
data-y (csv myfile.csv mycolumn)

size <>

Set rectangle size in both dimensions (x and y). Note that this value is only used if no sizes option is specified.

size <measure>
Examples:
;; set the rectangle size to 5pt
size 5pt

sizes <>

Load the rectangle sizes from data.

sizes (<values>...)
sizes (csv <file> <column>)
Examples:
;; list of static values
sizes (2pt 8pt 5pt)

;; load a csv file
sizes (csv myfile.csv mysizes)

size-x <>

Set rectangle size in the x dimension. Note that this value is only used if no sizes option is specified.

size <measure>
Examples:
;; set the rectangle width to 5pt
size-x 5pt

sizes-x <>

Load the rectangle widths from data

sizes-x (<values>...)
sizes-x (csv <file> <column>)
Examples:
;; list of static values
sizes-x (2pt 8pt 5pt)

;; load a csv file
sizes-x (csv myfile.csv mysizes)

size-y <>

Set rectangle size in the y dimension. Note that this value is only used if no sizes option is specified.

size <measure>
Examples:
;; set the rectangle height to 5pt
size-u 5pt

sizes-y <>

Load the rectangle heights from data

sizes-y (<values>...)
sizes-y (csv <file> <column>)
Examples:
;; list of static values
sizes-y (2pt 8pt 5pt)

;; load a csv file
sizes-y (csv myfile.csv mysizes)

color <color>

Set the rectangle color. Note that this value is only used if no data-colors option is specified.

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

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

colors <dataset_colors>

Set the 'colors' dataset for the plot. The 'colors' dataset will be used to calculate the color of rectangles. The mapping of input values to colors is controlled by the color-map option. If no explicit color-map option is provided, the values colors will be interpreted as hex color codes.

color-map <color_map>

Set the color map. Controls how the values in colors will be mapped to colors.

color-map <color-map>

scale-x <scale>

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

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

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 <limit_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 <limit-max>

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

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

limit-y <limit>

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 <limit_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 <limit-max>

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

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

Examples

Example: examples/charts-scientific/scalarfield


Edit this page on GitHub