HOZscale: add horizontal color scale

HOZscaleR Documentation

add horizontal color scale

Description

Add horizontal color scale to existing plot.

Usage

HOZscale(z, col, units="", SIDE=1, s1=.6, s2=0.95,
	    format=1, digits=3, cex=1, cex.units=1)

Arguments

z

image matrix

col

color palette

units

character string, units

SIDE

Side of the plot

s1

percent of margin for bottom

s2

percent of margin for top

format

Format: 1 for normal number, 2 for exponential notation

digits

Significant digits

cex

Character expansion for the numeric values.

cex.units

Character expansion for the units.

Value

Vector of rectangle coordinates and z-values: c(xmin,ymin, xmax, ymax, Z-min, Z-max)

Author(s)

Jonathan M. Lees<jonathan.lees.edu>

Examples

data(volcano)
image(volcano, col=terrain.colors(100))

HOZscale(volcano,terrain.colors(100) , units = "", SIDE = 1, s1 = 0.4, s2 = 0.95)


plot(1:10, 1:10, type='n')
j = c(runif(1, -10, 10) , runif(1, 20, 10000) )

### example showing scale above and below
HOZscale(j, terrain.colors(100),
          units="hi", SIDE=3, s1=.4, s2=0.6, format=2, digits=2, cex.units = 1.2, cex=1.2)

j = c(runif(1, -10, 10)/1000 , runif(1, 1, 10) )

HOZscale(j, terrain.colors(100),
          units="hi", SIDE=1, s1=.6, s2=0.8, format=2, digits=2, cex.units = 0.8)



RPMG documentation built on Aug. 19, 2023, 5:12 p.m.