map | R Documentation |
Make map of geophysical data. These plot functions are S3 methods for esd objects.
map(x, ...)
x |
the object to be plotted; in |
... |
further arguments passed to or from other methods. |
FUN |
The function to be applied on x before mapping (e.g. |
colbar |
The colour scales defined through |
lab |
|
it |
see |
is |
see |
new |
TRUE: create a new graphic device. |
projection |
Projections: c("lonlat","sphere","np","sp") - the latter
gives stereographic views from the North and south poles. Other types of projections
are also possible based on a wrapper function for |
xlim |
see |
ylim |
see |
n |
The number of colour breaks in the color bar |
breaks |
graphics setting - see |
gridlines |
Only for the lon-lat projection |
lonR |
Only for the spherical projection used by |
latR |
Only for the spherical projection used by |
axiR |
Only for the spherical projection used by |
style |
Only for the spherical projection used by |
y |
a vector of y coordinates |
z |
a vector of z coordinates |
ip |
Selects which pattern (see |
geography |
TRUE: plot geographical features |
angle |
for hatching |
a |
used in |
r |
used in |
ix |
used to subset points for plotting errors |
iy |
used to subset points for plotting errors |
colorbar |
Show the color bar in the map (default TRUE). If FALSE, the colorbar is not added into the map (ignored). |
cex |
Size of symbols. |
cex0 |
Scaling of symbols if |
cex.subset |
... |
add.text |
Add abbreviated location names. |
full.names |
Show the full name of the location. |
showall |
Default is set to FALSE |
showaxis |
If set to FALSE, the axis are not displayed in the plot. |
fancy |
If set to true, will use |
text |
If TRUE, display text info on the map.The default is set to FALSE |
show.val |
Display the values of 'x' or 'FUN(x)' on top of the coloured map. |
legend.shrink |
If set, the size of the color bar is shrinked (values between 0 and 1) |
land |
if TRUE mask land, else mask ocean |
what |
What to map: ['eof','field] for EOF pattern or the field |
type |
- default c('fill','contour') recovered from the EOFs. |
fig |
see |
add |
set add=TRUE if adding the map as a subplot |
nbins |
number of bins/colour categories |
A field object
map.trajectory vec map.dsensemble
plot.station
, showmaps
# Select stations in ss and map the geographical location
# of the selected stations with a zoom on Norway.
ss <- select.station(cntr="NORWAY",param="precip",src="GHCND")
map(ss, col="blue",bg="lightblue",xlim = c(-10,30) , ylim = c(50,70), new=FALSE)
## Get NACD data and map the mean values
y <- station.nacd()
map(y,FUN='mean',colbar=list(pal="t2m",n=10), cex=2, new=FALSE)
## Adjust rotation of the color axis ticks
map(y,FUN='mean',colbar=list(pal="t2m",n=10,srt=0), cex=2, new=FALSE)
# Examples of cyclone maps (map.events)
data(storms)
# Subset cyclones from the start of January 2016 lasting a minimum of 10 time steps
x <- subset(storms,it=c("2016-01-01","2016-01-07"),ic=list(param="trackcount",pmin=10))
# Map with points and lines showing the cyclone centers and trajectories
map(x, type=c("trajectory","points"), col="blue")
## Map with only the trajectory and start and end points
map(x, type=c("trajectory","start","end"), col="red")
## Map showing the cyclone depth (slp at center) as a color scale (rd = red scale)
map(x, param="pcent", type=c('trajectory','start'),
colbar=list(pal="rd", rev=TRUE, breaks=seq(980,1000,2)),
alpha=0.9, new=FALSE)
# Example showing two maps in one figure:
## Not run:
rr <- retrieve('~/data/data.ECAD/rr_ens_mean_0.1deg_reg.nc',it=c(2000,2001))
it <- 195
par(mfcol=c(1,2))
attr(rr,'variable') <- 'precip'
map(rr,FUN='mean',new=FALSE,type='fill',colbar=NULL,lab=paste(range(index(rr)),collapse=' - '))
map(subset(rr,it=it),FUN='mean',new=FALSE,type='fill',colbar=NULL,lab=as.character(index(rr)[it]))
## End(Not run)
## Example: plotting maps with different projections
t2m <- t2m.NCEP()
# Spherical map, centered around 45 degrees E / 45 degrees N
map(t2m, projection="sphere", lonR=45, latR=45)
# Spherical map showing the trend, overlayed with contours of the mean field
lonR <- 45; latR <- 90
map(t2m, FUN="trend", projection="sphere", lonR=lonR, latR=latR, type="fill")
spherical_contour(t2m, FUN="mean", lonR=lonR, latR=latR, add=TRUE)
# Spherical map centered around the north pole
map(t2m, projection="np")
# Projections based on the function oce::mapPlot
map(t2m,projection="+proj=moll")
# Night mode: dark background
map(t2m, projection="np", style='night')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.