trajPlot | R Documentation |
This function plots back trajectories. This function requires that data are
imported using the importTraj
function.
trajPlot(
mydata,
lon = "lon",
lat = "lat",
pollutant = "height",
type = "default",
map = TRUE,
group = NA,
map.fill = TRUE,
map.res = "default",
map.cols = "grey40",
map.alpha = 0.4,
projection = "lambert",
parameters = c(51, 51),
orientation = c(90, 0, 0),
grid.col = "deepskyblue",
npoints = 12,
origin = TRUE,
plot = TRUE,
...
)
mydata |
Data frame, the result of importing a trajectory file using
|
lon |
Column containing the longitude, as a decimal. |
lat |
Column containing the latitude, as a decimal. |
pollutant |
Pollutant to be plotted. By default the trajectory height is used. |
type |
It is also possible to choose
|
map |
Should a base map be drawn? If |
group |
It is sometimes useful to group and colour trajectories according to a grouping variable. See example below. |
map.fill |
Should the base map be a filled polygon? Default is to fill countries. |
map.res |
The resolution of the base map. By default the function uses
the ‘world’ map from the |
map.cols |
If |
map.alpha |
The transparency level of the filled map which takes values from 0 (full transparency) to 1 (full opacity). Setting it below 1 can help view trajectories, trajectory surfaces etc. and a filled base map. |
projection |
The map projection to be used. Different map projections
are possible through the |
parameters |
From the |
orientation |
From the |
grid.col |
The colour of the map grid to be used. To remove the grid set
|
npoints |
A dot is placed every |
origin |
If true a filled circle dot is shown to mark the receptor point. |
plot |
Should a plot be produced? |
... |
other arguments are passed to |
Several types of trajectory plot are available. trajPlot
by default
will plot each lat/lon location showing the origin of each trajectory, if no
pollutant
is supplied.
If a pollutant is given, by merging the trajectory data with concentration
data (see example below), the trajectories are colour-coded by the
concentration of pollutant
. With a long time series there can be lots
of overplotting making it difficult to gauge the overall concentration
pattern. In these cases setting alpha
to a low value e.g. 0.1 can
help.
The user can also show points instead of lines by plot.type = "p"
.
Note that trajPlot
will plot only the full length trajectories. This
should be remembered when selecting only part of a year to plot.
David Carslaw
Other trajectory analysis functions:
importTraj()
,
trajCluster()
,
trajLevel()
# show a simple case with no pollutant i.e. just the trajectories
# let's check to see where the trajectories were coming from when
# Heathrow Airport was closed due to the Icelandic volcanic eruption
# 15--21 April 2010.
# import trajectories for London and plot
## Not run:
lond <- importTraj("london", 2010)
# well, HYSPLIT seems to think there certainly were conditions where trajectories
# orginated from Iceland...
trajPlot(selectByDate(lond, start = "15/4/2010", end = "21/4/2010"))
## End(Not run)
# plot by day, need a column that makes a date
## Not run:
lond$day <- as.Date(lond$date)
trajPlot(selectByDate(lond, start = "15/4/2010", end = "21/4/2010"),
type = "day")
## End(Not run)
# or show each day grouped by colour, with some other options set
## Not run:
trajPlot(selectByDate(lond, start = "15/4/2010", end = "21/4/2010"),
group = "day", col = "turbo", lwd = 2, key.pos = "right", key.col = 1)
## End(Not run)
# more examples to follow linking with concentration measurements...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.