ColorMatrix {greenbrown}R Documentation

Create a square matrix of colors

Description

This function creates a square matrix with two diagonal crossing color ramps. It can be used to plot contingency maps of two classifications.

Usage

ColorMatrix(dim = 3, ul = "burlywood4", lr = "darkgreen", ll = "khaki1", 
    ur = "royalblue1", ctr = "gray87")

Arguments

dim

number of rows and number of columns of the matrix (only square matrix are possible, i.e. number of rows = number columns)

ul

starting color in the upper left corner of the matrix

lr

ending color in the lower right corner of the matrix

ll

starting color in the lower left corner of the matrix

ur

ending color in the upper right corner of the matrix

ctr

color in the center of the matrix

Value

The function returns a square matrix of color names.

Author(s)

Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre]

Examples

col.m <- ColorMatrix()
plot.new()
legend("topleft", as.vector(col.m), fill=col.m, ncol=3)

col.m <- ColorMatrix(dim=5, ul="red", ll="navy", ctr="purple")
plot.new()
legend("topleft", as.vector(col.m), fill=col.m, ncol=5)

[Package greenbrown version 2.4.3 Index]