Learn R Programming

plotKML (version 0.8-3)

display.pal: Display a color palette

Description

Plots a color palette in a new window.

Usage

display.pal(pal, sel=1:length(pal), names=FALSE)

Arguments

pal

list; each palette a vector of HEX-formated colors

sel

integer; selection of palettes to plot

names

logical; specifies whether to print also the class names

Details

The internal palettes available in plotKML typically consists of 20 elements. If class names are requrested (names=TRUE) than only one palette will be plotted.

See Also

SAGA_pal, R_pal, worldgrids_pal

Examples

Run this code
# NOT RUN {
# SAGA GIS palette (http://saga-gis.org/en/about/software.html)
data(SAGA_pal)
names(SAGA_pal)
# }
# NOT RUN {
# display palettes:
display.pal(pal=SAGA_pal, sel=c(1,2,7,8,10,11,17,18,19,21,22))
dev.off()
data(worldgrids_pal)
worldgrids_pal[["globcov"]]
display.pal(pal=worldgrids_pal, sel=c(5), names = TRUE)
dev.off()
# make icons (http://www.statmethods.net/advgraphs/parameters.html):
for(i in 0:25){
  png(filename=paste("icon", i, ".png", sep=""), width=45, height=45, 
  bg="transparent", pointsize=16)
  par(mar=c(0,0,0,0))
  plot(x=1, y=1, axes=FALSE, xlab='', ylab='', pch=i, cex=4, lwd=2)
  dev.off()
}
# }

Run the code above in your browser using DataLab