View source: R/map.trajectory.R
map.trajectory | R Documentation |
map.trajectory
is an S3
method for making different types of trajectory maps.
By default, map.trajectory
shows individual trajectories, but the
number density of trajectories can also be visualised by using the argument type='denisty'
.
## S3 method for class 'trajectory'
map(
x,
it = NULL,
is = NULL,
type = "trajectory",
param = NA,
projection = "lonlat",
verbose = FALSE,
...
)
x |
the trajectory object to be plotted. |
it |
A list or data.frame providing time index, e.g. month |
is |
A list or data.frame providing space index, e.g. station record |
type |
type of map: 'paths' shows trajectories; 'density' shows the spatial density of the trajectories; 'colors' shows colored trajectories where the colorscale represents 'param'; 'anomaly' or 'shape' show only the longitude and latitude displacement of the trajectories |
projection |
Projections: c("lonlat","sphere","np","sp") - the latter gives stereographic views from the North and south poles. |
parameter |
to display as a color scale |
col |
color of trajectories |
colmap |
Colour scales, either as an output from |
new |
TRUE: create a new graphics device |
xlim |
see |
ylim |
see |
main |
an overall title for the plot |
lonR |
Only for the spherical projection - see |
latR |
Only for the spherical projection - see |
leg |
logical. If TRUE, legend is shown. |
alpha |
factor modifying the opacity alpha; typically in [0,1] |
The functions hexbin.trajectory
and sunflower.trajectory
produce alternative versions of trajectory density maps.
map map.events
# plot storm tracks zoomed in on the north Atlantic and northern Europe
data(imilast.M03)
map(imilast.M03,col="blue",alpha=0.1,
projection='latlon',xlim=c(-60,60),ylim=c(30,90),
new=FALSE)
# spherical projection
map(imilast.M03,col="blue",alpha=0.1,projection='sphere',new=FALSE)
# Quick way of plotting the number density for grid boxes
# of the width 2 degrees (dx) and height 1 degree (dy).
map(imilast.M03,type="hexbin",xlim=c(-60,60),ylim=c(30,90),dx=2,dy=1,new=FALSE)
map(imilast.M03,type="sunflower",xlim=c(-60,60),ylim=c(30,90),dx=2,dy=1,new=FALSE)
## Not run:
# Calculate and plot the cyclone density - this takes a little while
cdens <- as.field(imilast.M03)
map(cdens,new=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.