color.gradient is now just a call to color.scale with a vector of equally spaced integers (1:nslices). The function is kept for backward compatibility.
vectors of the values of the color components as 0 to 1.
The number of color "slices".
A vector of hexadecimal color values as used by col.
The function is mainly useful for defining a set of colors to represent a known number of gradations. Such a set can be used to assign a grade to a small number of values (e.g. points on a scatterplot - but see color.scale for large numbers) and display a color bar using gradient.rect as a legend.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.