get.cb.pos: Returns additional colorbar placement information

View source: R/get.cb.pos.r

get.cb.posR Documentation

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(s)

Robert K. Bauer

See Also

set.colorbar, cust.colorbar, region_definitions

Examples

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)

oceanmap documentation built on Nov. 10, 2023, 5:08 p.m.