Learn R Programming

oceanmap (version 0.1.6)

get.cb.pos: Returns additional colorbar placement information

Description

Returns colorbar ticks length, label-, cb.title- and cb.xlab-position. ticks.lab, cb.title and cb.lab are horizontally centered, so only the y-value is returned.

Usage

get.cb.pos(cbx,cby,oticks)

Arguments

cbx

the horizontal limits (x1, x2) of the colorbar.

cby

the vertical limits (y1, y2) of the colorbar.

oticks

letter defining alignment of colorbar ticks and labels. Allowed values are: 'b' for bottom, 'l' for left and 'r' for right alignment.

Author

Robert K. Bauer

See Also

set.colorbar, cust.colorbar, region_definitions

Examples

Run this code
path <- system.file("test_files", package="oceanmap")
gz.files <- Sys.glob(paste0(path,'/*.gz')) # load sample-'.gz'-files

obj <- readbin(gz.files[2],area='lion')
ncorse <- crop(obj,extent(6,9,40,42))
cbx <-c(8.3,8.9)
cby <- c(40.7,40.8)
v(ncorse,zlim=c(20,30),cbx=cbx,cby=cby) # skipping colorbar widget

get.cb.pos(cbx=cbx,cby=cby,oticks="b") 

#dev.new()
#image(obj)
#align <- set.colorbar()
#get.cb.pos(cbx=align$cbx,cby=align$cby,oticks=align$oticks)

Run the code above in your browser using DataLab