display.pal: Display a color palette

Description Usage Arguments Details Author(s) See Also Examples

View source: R/color_palettes.R

Description

Plots a color palette in a new window.

Usage

1
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.

Author(s)

Tomislav Hengl and Pierre Roudier

See Also

SAGA_pal, R_pal, worldgrids_pal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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()
}

## End(Not run)

Example output

plotKML version 0.5-8 (2017-05-12)
URL: http://plotkml.r-forge.r-project.org/
 [1] "SG_COLORS_DEFAULT"         "SG_COLORS_DEFAULT_BRIGHT" 
 [3] "SG_COLORS_WHITE_BLACK"     "SG_COLORS_RED_BLACK"      
 [5] "SG_COLORS_GREEN_BLACK"     "SG_COLORS_BLUE_BLACK"     
 [7] "SG_COLORS_WHITE_RED"       "SG_COLORS_WHITE_GREEN"    
 [9] "SG_COLORS_WHITE_BLUE"      "SG_COLORS_YELLOW_RED"     
[11] "SG_COLORS_YELLOW_GREEN"    "SG_COLORS_YELLOW_BLUE"    
[13] "SG_COLORS_GREEN_RED"       "SG_COLORS_BLUE_RED"       
[15] "SG_COLORS_BLUE_GREEN"      "SG_COLORS_BLUE_GREY_RED"  
[17] "SG_COLORS_GREEN_GREY_RED"  "SG_COLORS_BLUE_GREY_GREEN"
[19] "SG_COLORS_BLUE_GREEN_RED"  "SG_COLORS_RED_BLUE_GREEN" 
[21] "SG_COLORS_GREEN_RED_BLUE"  "SG_COLORS_RAINBOW"        
png 
  2 
                                                                             Post-flooding or irrigated croplands (or aquatic) 
                                                                                                                     "#AAF0F0" 
                                                                                                             Rainfed croplands 
                                                                                                                     "#FFFF64" 
                                                   Mosaic cropland (50-70%) / vegetation (grassland/shrubland/forest) (20-50%) 
                                                                                                                     "#DCF064" 
                                                  Mosaic vegetation (grassland/shrubland/forest) (50-70%) / cropland (20-50%)  
                                                                                                                     "#CDCD66" 
                                                    Closed to open (>15%) broadleaved evergreen or semi-deciduous forest (>5m) 
                                                                                                                     "#006400" 
                                                                              Closed (>40%) broadleaved deciduous forest (>5m) 
                                                                                                                     "#00A000" 
                                                                     Open (15-40%) broadleaved deciduous forest/woodland (>5m) 
                                                                                                                     "#AAC800" 
                                                                             Closed (>40%) needleleaved evergreen forest (>5m) 
                                                                                                                     "#003C00" 
                                                                Open (15-40%) needleleaved deciduous or evergreen forest (>5m) 
                                                                                                                     "#286400" 
                                                         Closed to open (>15%) mixed broadleaved and needleleaved forest (>5m) 
                                                                                                                     "#788200" 
                                                                      Mosaic forest or shrubland (50-70%) / grassland (20-50%) 
                                                                                                                     "#8CA000" 
                                                                     Mosaic grassland (50-70%) / forest or shrubland (20-50%)  
                                                                                                                     "#BE9600" 
                                   Closed to open (>15%) (broadleaved or needleleaved, evergreen or deciduous) shrubland (<5m) 
                                                                                                                     "#966400" 
                                           Closed to open (>15%) herbaceous vegetation (grassland, savannas or lichens/mosses) 
                                                                                                                     "#FFB432" 
                                                                                                      Sparse (<15%) vegetation 
                                                                                                                     "#FFEBAF" 
        Closed to open (>15%) broadleaved forest regularly flooded (semi-permanently or temporarily) - Fresh or brackish water 
                                                                                                                     "#00785A" 
                                  Closed (>40%) broadleaved forest or shrubland permanently flooded - Saline or brackish water 
                                                                                                                     "#009678" 
Closed to open (>15%) grassland or woody vegetation on regularly flooded or waterlogged soil - Fresh, brackish or saline water 
                                                                                                                     "#00DC82" 
                                                                   Artificial surfaces and associated areas (Urban areas >50%) 
                                                                                                                     "#C31400" 
                                                                                                                    Bare areas 
                                                                                                                     "#FFF5D7" 
                                                                                                                  Water bodies 
                                                                                                                     "#0046C8" 
                                                                                                        Permanent snow and ice 
                                                                                                                     "#FFFFFF" 
                                                                                                No data (burnt areas, clouds,) 
                                                                                                                     "#000000" 
null device 
          1 

plotKML documentation built on April 27, 2021, 3:01 p.m.