add_RefGrid: Add a Reference grid

Description Usage Arguments See Also Examples

View source: R/add_RefGrid.R

Description

Add a Latitude/Longitude reference grid to maps.

Usage

1
2
3
4
5
6
7
8
9
add_RefGrid(
  bb,
  ResLat = 1,
  ResLon = 2,
  LabLon = NA,
  lwd = 1,
  fontsize = 1,
  offset = NA
)

Arguments

bb

bounding box of the first plotted object. for example, bb=bbox(SmallBathy) or bb=bbox(MyPolys).

ResLat

Latitude resolution in decimal degrees.

ResLon

Longitude resolution in decimal degrees.

LabLon

Longitude at which Latitude labels should appear. if set, the resulting Reference grid will be circumpolar.

lwd

Line thickness of the Reference grid.

fontsize

Font size of the Reference grid's labels.

offset

offset of the Reference grid's labels (distance to plot border).

See Also

load_Bathy, SmallBathy.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#Example 1: Circumpolar grid with Latitude labels at Longitude 0

Mypar=par(mai=c(1,1.5,0.5,0)) #Figure margins as c(bottom, left, top, right)
par(Mypar)
plot(SmallBathy,breaks=Depth_cuts, col=Depth_cols, legend=FALSE,axes=FALSE,box=FALSE)
add_RefGrid(bb=bbox(SmallBathy),ResLat=10,ResLon=20,LabLon = 0)

#Example 2: Local grid around created polygons

MyPolys=create_Polys(PolyData,Densify=TRUE)
BathyC=raster::crop(SmallBathy,MyPolys) #crop the bathymetry to match the extent of MyPolys
Mypar=par(mai=c(0.5,0.5,0.5,0.5)) #Figure margins as c(bottom, left, top, right)
par(Mypar)
plot(BathyC,breaks=Depth_cuts, col=Depth_cols, legend=FALSE,axes=FALSE,box=FALSE)
add_RefGrid(bb=bbox(BathyC),ResLat=2,ResLon=6)
plot(MyPolys,add=TRUE,col='orange',border='brown',lwd=2)

CCAMLRGIS documentation built on Sept. 8, 2021, 9:09 a.m.