| create_scale | R Documentation |
Create colour scale used in topographic figures
create_scale(col_range, k = NULL)
col_range |
A numeric vector with required range of the variable to be plotted in the colour scale. |
k |
A number from interval (0,1) indicating a sequence step for the colour palette. The smaller number, the finer division of the data range interval. See Details for more information about auto-computing if |
The palette is created according to topographical colours: negative values correspond to shades of blue and purple and positive values to shades of green, yellow and red. The zero value of the variable is always at the border of blue and green shades.
To compare results for different subjects or conditions, set the same col_range for all cases. Otherwise, the colours are assigned separately in each plot and are not consistent with each other.
The parameter k is set by default with respect to the range of col_range as follows:
k = 0.1 for range \leq 30,
k = 0.03 for range \geq 70,
k = 0.04 otherwise.
A list with two components:
colors |
A vector with hexadecimal codes of palette colours. |
breaks |
A vector with breaks for cutting the data range. |
The list is intended for use in scale_fill_gradientn or similar plotting calls.
# Create scale on interval (-10,10) with default step number
create_scale(col_range = c(-10,10))
# Create scale on interval c(-5,10) with small k (finer division)
create_scale(col_range = c(-5, 10), k = 0.02)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.