Description Usage Arguments Examples
Generates a kml including the heading
1 2 3 |
x |
= x axis values |
y |
= y axis values |
colors |
= vector of colors |
len |
= width of the bar given as a proportion of x and y axis |
pos |
= maximum x and y coordinate |
dist |
= the distance from the border |
place |
= placement of the bar in the plot window (upperright, lowerleft, upperleft, lowerright) |
bars |
= number of bars to distinguish in the gradient |
tdist |
= distance of text from gradient bar |
labels |
= vector with min and max value |
tcol |
text color of labels and title |
if |
pos is null dist and place can be used to set the position of the |
If |
pos is null than dist (distance from border) and place (upperright, lowerleft, upperleft, lowerright) is used to determine the position |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | EXAMPLE 1
x <- 1:100
y <- (1:100)/5
colors <- colorRampPalette(c('grey90','grey20'))(100)
plot(x,y, col=colors)
gradient(x,y, col=colors)
EXAMPLE 2
If there are less than 20 colors no bars are plotted
colors <- colorRampPalette(c('grey90','grey20'))(10)
plot(x,y, col=colors)
gradient(x,y, col=colors)
EXAMPLE 3
x <- 1:100
y <- (1:100)/5
colors <- colorRampPalette(c('grey90','grey20'))(100)
plot(x,y, col=colors)
Add gradient using pos (values of x and y axis) or using dist (distance from border) and place (upperright, upperleft,...)
gradient(x,y, col=colors, pos=c(21,18)) # using pos
gradient(x,y, col=colors, dist=c(0.1,0.1), place = 'upperleft') # using dist and place
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.