Last data update: 2014.03.03

R: Add a north arrow to a map
North ArrowR Documentation

Add a north arrow to a map

Description

Draws a north arrow on a map.

Usage

north.arrow(xb,yb,len,lab='NORTH',cex.lab=1,tcol='black',...)

Arguments

xb

The x-centre (in map units) of the arrow base.

yb

The y-centre (in map units) of the arrow base.

len

The length (in map units) of the arrow base.

lab

The label for the arrow.

cex.lab

Scale factor for the label for the arrow.

tcol

The colour of the label text.

...

Other graphical parameters passed to the drawing of the arrow.

Details

Draws a north arrow on a map. The arrow itself is drawn using polygon and any extra parameters are passed to this call.

Value

None.

Author(s)

Chris Brunsdon

See Also

map.scale

Examples

# Read in map data for New Haven
data(newhaven)
# Plot census block boundaries
plot(blocks)
# Add a north arrow
north.arrow(534750,152000,miles2ft(0.5),col='cyan')
# ... and a title
title('New Haven (CT)')

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GISTools)
Loading required package: maptools
Loading required package: sp
Checking rgeos availability: TRUE
Loading required package: RColorBrewer
Loading required package: MASS
Loading required package: rgeos
rgeos version: 0.3-19, (SVN revision 524)
 GEOS runtime version: 3.5.0-CAPI-1.9.0 r4084 
 Linking to sp version: 1.2-3 
 Polygon checking: TRUE 

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GISTools/north.arrow.Rd_%03d_medium.png", width=480, height=480)
> ### Name: North Arrow
> ### Title: Add a north arrow to a map
> ### Aliases: north.arrow
> 
> ### ** Examples
> 
> # Read in map data for New Haven
> data(newhaven)
> # Plot census block boundaries
> plot(blocks)
> # Add a north arrow
> north.arrow(534750,152000,miles2ft(0.5),col='cyan')
> # ... and a title
> title('New Haven (CT)')
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>