Command: plot/vectors

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

Syntax

(plot/vectors <options>)
(plot/vectors 
data-x (...)
data-y (...)
data-x (...)
data-y (...)
size (...)
sizes (...)
size-map (...)
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 arrows.

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 arrows.

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

Set the 'dx' dataset for the plot. The 'x' dataset will be used to calculate the horizontal size of arrows.

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 'dy' dataset for the plot. The 'y' dataset will be used to calculate the vertical size of arrows.

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 the vector size.

size <measure>
Examples:
;; set size to 2pt
size 2pt

sizes

Set an individual size for each vector

Examples:
['charts-scientific/vectorfield']

size-map

Controls how input data in sizes is mapped to typographic units.

Examples:
['charts-scientific/vectorfield']

color

Set the vector color. Note that this value is only used if no 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

Set an individual color for each vector. If no explicit color-map option is provided, the values in colors will be interpreted as hex color codes. Otherwise the mapping of input data to colors is controlled by the color-map option.

Examples:
['charts-scientific/vectorfield']

color-map

Controls how input data is mapped to colors. If no map is specified, the values in colors will be interpreted as hex color values.

Examples:
['charts-scientific/vectorfield']

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.

Examples:
['charts-scientific/vectorfield']

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:
['charts-scientific/vectorfield']

Examples

Example: examples/charts-scientific/vectorfield


Edit this page on GitHub