image.map.Rd
Draw an image plot with geographical coordinates and coastlines.
# S3 method for class 'map'
image(
lon,
lat,
z,
zlim = NULL,
legend = TRUE,
hires = FALSE,
add = FALSE,
nlevel = 1000,
horizontal = FALSE,
legend.shrink = 0.9,
legend.width = 1.2,
slice = NULL,
legend.mar = ifelse(horizontal, 3.1, 5.1),
legend.lab = NULL,
graphics.reset = FALSE,
bigplot = NULL,
smallplot = NULL,
legend.only = FALSE,
col = rev(rainbow(nlevel/10, start = 0/6, end = 4/6)),
lab.breaks = NULL,
axis.args = NULL,
legend.args = NULL,
axes = TRUE,
midpoint = FALSE,
border = TRUE,
lwd = 1,
land = TRUE,
land.col = "black",
labels = TRUE,
sea.col = "white",
boundaries.col = "grey",
grid = FALSE,
grid.col = "white",
grid.lwd = 0.5,
...
)
x-axis coordinates, assumed to be longitude (degrees)
y-axis coordinates, assumed to be latitude (degrees)
A matrix of dimension [lon x lat]
numeric vector of length 2, giving the z matrix plotted range.
Boolean, add color legend? FALSE can be used to construct multiple plots with a common legend.
Boolean, use high resolution coastline?
If true add image and a legend strip to the existing plot.
Number of color levels used in legend strip
If false (default) legend will be a vertical strip on the right side. If true the legend strip will be along the bottom.
Amount to shrink the size of legend relative to the full height or width of the plot.
Width in characters of the legend strip. Default is 1.2, a little bigger that the width of a character.
If z is an 3D array, slice indicates which layer will be used.
Width in characters of legend margin that has the axis. Default is 5.1 for a vertical legend and 3.1 for a horizontal legend.
Label for the axis of the color legend. Default is no label as this is usual evident from the plot title.
If FALSE (default) the plotting region ( plt in par) will not be reset and one can add more information onto the image plot. (e.g. using functions such as points or lines.) If TRUE will reset plot parameters to the values before entering the function.
Plot coordinates for image plot. If not passed these will be determined within the function.
Plot coordinates for legend strip. If not passed these will be
determined within
the function. Be sure to leave room for the axis labels. For example, if
the legend is on the
right side smallplot= c(.85,.9,0,1)
will leave (.1 in plot
coordinates) for the
axis labels to the right of the color strip. This argument is useful
for drawing a
plot with the legend that is the same size as the plots without legends.
If TRUE just add the
legend to a the plot in the plot region defined by the coordinates in
smallplot. In the absence of other information the range for the legend
is determined from the zlim
argument.
Color table to use for image, by default rev(rainbow(nlevel/10, start = 0/6, end = 4/6))
If breaks are supplied these are text string labels to put at each break value. This is intended to label axis on a transformed scale such as logs.
Additional arguments for the axis function used to create the legend axis. (See example below adding a log scaling.)
Arguments for a complete specification of the legend label, e.g. if you need to the rotate text or other details. This is in the form of list and is just passed to the mtext function and you will need to give both the side and line arguments for positioning. This usually will not be needed. (See example below.)
Boolean, add axes to the plot? Default is TRUE.
This option for the case of unequally spaced grids with x and y being matrices of grid point locations. If FALSE (default) the quadralaterals will be extended to surround the z locations as midpoints. If TRUE z values will be averaged to yield a midpoint value and the original grid points be used to define the quadralaterals. (See help on poly.image for details). In most cases midpoint should be FALSE to preserve exact values for z and let the grid polygons be modified.
This only works if x and y are matrices – if NA the quadralaterals will have a border color that is the same as the interior color. Otherwise this specifies the color to use.
Line width of bordering lines around pixels. This might need to be set less than 1.0 to avoid visible rounding of the pixel corners.
Boolean, add a polygon over the land? If FALSE, only coastline is added.
Color of the land, if land is TRUE.
Boolean, add LATITUDE and LONGITUDE labels?
Color of the water bodies.
Color of the country boundaries.
Boolean, add grid lines over the map?
Color of the grid.
Width of the grid lines.
Additional parameters passed to plot methods.