View source: R/gradient_color_scale.R
| gradient.color.scale | R Documentation | 
Create gradient color scale with midpoint
gradient.color.scale(
  minval,
  maxval,
  n = 11,
  low = "blue",
  mid = "white",
  high = "red",
  midpoint = 0,
  ...
)
minval | 
 The minimum value of the data to be colored  | 
maxval | 
 The maximum value of the data to be colored  | 
n | 
 The desired number of breaks (approximately)  | 
low | 
 The color for the low values  | 
mid | 
 The color used for the midpoint of the gradient  | 
high | 
 The color used for the high values  | 
midpoint | 
 The midpoint of the color scale  | 
... | 
 Arguments passed to   | 
A list with col and breaks components specifying the colors and breaks of the color scale.
Based on code from https://stackoverflow.com/a/10986203/5931362
data(grave)
lr = logrr(grave)
grad = gradient.color.scale(min(lr$v, na.rm = TRUE), max(lr$v, na.rm = TRUE))
plot(lr, col = grad$col, breaks = grad$breaks)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.