Description Usage Arguments Details Value Author(s) See Also Examples
Expands GIS palette to desired length and range of data values.
1 |
name |
The name of a built-in GIS palette. One of |
pal |
A GIS palette. One of |
n |
The number of colors desired. Cannot be smaller than the size of the original palette. If not specified, the size of the original palette is preserved. |
zlim |
The desired output range of data values. Must be specified for percentage-based palettes. |
Linear interpolation is used to add both value levels and colors between those specified explicitly in the palette.
Returns a data frame with three columns:
value |
The data value or percentage associated with each color. |
pct |
TRUE if the entry is a percentage; FALSE for a data value. |
color |
Color specification in hexadecimal format. |
Sarah Goslee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # different sizes of palette
par(mfrow=c(5,1))
display.gis.pal(pal=gis.pal("gyr", n=3, zlim=c(0,1)))
display.gis.pal(pal=gis.pal("gyr", n=4, zlim=c(0,1)))
display.gis.pal(pal=gis.pal("gyr", n=5, zlim=c(0,1)))
display.gis.pal(pal=gis.pal("gyr", n=13, zlim=c(0,1)))
display.gis.pal(pal=gis.pal("gyr", n=28, zlim=c(0,1)))
# color an image
mat1 <- matrix(runif(100), 10, 10)
pal1 <- gis.pal("gyr", n=11, zlim=c(0,1))
pal1
gis.pal.info("gyr")
layout(matrix(c(1,1,1,2), ncol=1))
gisimage(mat1, pal1, legend=FALSE)
display.gis.pal(pal=pal1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.