Description Arguments References Examples
Plots the distribution of x and y on grid. This function follows the method described in Simons et al 2013: first vertically integrating the data, then dividing by the number of particles spawned, and finally applying an Gaussian blur filter. The coordinates should be passed in as x,y in meters, then are inverse projected into lat/long using the PROJ.4 library.
grid |
A |
xy |
A |
npoints |
The number of points to scale the density plot by. This defaults to the number of points passed in, but it may be useful to set it to a different value if only a subset of the points are being plotted (e.g. some points are outside of the domain). |
res |
The resolution of the plot in the same
dimensions as |
sigma |
The standard deviation of the Gaussian
smoothing filter to be applied. If no filter is required,
set sigma=0. The units should be the same as for
|
log |
Should the density be log10 transformed before plotting? |
bg.col |
The background color. |
col |
A list of colors, such as that returned by heat.colors. |
add |
Should the plot be added to the current plot? |
xlim |
x-limits for the plot. |
ylim |
y-limits for the plot. |
lim.units |
Units for xlim and ylim. One of 'm' (meters) or 'll' (latitude and longitude). |
zlim |
z-limits for the plot. |
Simons, R.D. and Siegel, D.A. and Brown K.S. 2013 Model sensitivity and robustness in the estimation of larval transport: A study of particle tracking parameters J. Marine Systems 119–120: 19–29.
1 2 3 4 5 6 7 8 9 10 | {
# Generate artificial data from a Gaussian distribution
nodes = get.nodes(ocean.demo.grid)
set.seed(1)
x = rnorm(50000, mean(nodes$x), sd(nodes$x))
y = rnorm(50000, mean(nodes$y), sd(nodes$y))
# Plot the density of the mixture
res = (max(nodes$x) - min(nodes$x)) / 50
grd = pdd(ocean.demo.grid, data.frame(x=x, y=y), res=res, sigma=5)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.