vec: Draw vectors on maps for esd objects

View source: R/vec.R

vecR Documentation

Draw vectors on maps for esd objects

Description

Plot arrows for e.g. a wind field or ocean currents.

Usage

vec(
  x,
  y,
  it = NULL,
  a = NULL,
  r = 1,
  ix = NULL,
  iy = NULL,
  new = TRUE,
  nx = 150,
  ny = 80,
  projection = "lonlat",
  lonR = NULL,
  latR = NULL,
  axiR = 0,
  verbose = FALSE,
  length = NULL,
  ...
)

Arguments

x

the zonal comonents of the vectors

y

the meridional comonents of the vectors

it

see subset

a

used to scale the length of the arrows

r

used to make a 3D effect of plotting the arrows up in the air.

new

TRUE: create a new graphic device.

nx

is the number of vectors/points along the x-axis

ny

is the number of vectors/points along the y-axis

projection

Projections: c("lonlat","sphere","np","sp") - the latter gives stereographic views from the North and south poles.

lonR

Only for the spherical projection

latR

Only for the spherical projection

axiR

Only for the spherical projection

xlim

see plot - only used for 'lonlat' and 'sphere' projections.

ylim

see plot - only used for 'lonlat' and 'sphere' projections.

n

The number of colour breaks in the color bar

breaks

graphics setting - see image

type

graphics setting - colour shading or contour

gridlines

Only for the lon-lat projection

is

see subset

See Also

map

Examples

## Not run: 
sst <- sst.NCEP()
download.file('ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis.derived/surface/uwnd.mon.mean.nc','ncep_u.nc')
download.file('ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis.derived/surface/vwnd.mon.mean.nc','ncep_v.nc')
u <- retrieve('ncep_u.nc')
v <- retrieve('ncep_v.nc')
## Make a map of SSt and wind vectors:
map(sst)
vec(u,v,a=1.5,length=0.03,new=FALSE)

## Make a fancy map
map(sst,projection='sphere')
vec(u,v,a=0.5,r=1.1,length=0.03,projection='sphere',new=FALSE)

## End(Not run)



metno/esd documentation built on April 29, 2024, 3:34 p.m.