Given some minimal input information, SOmap_auto
will attempt to guess an appropriate extent and projection to use. For demonstration purposes, run the function without any inputs at all and it will use random location data.
SOmap_auto(
x,
y,
centre_lon = NULL,
centre_lat = NULL,
target = "stere",
dimXY = c(512, 512),
bathy = TRUE,
land = TRUE,
land_col = "black",
ice = TRUE,
ice_col = "black",
input_points = TRUE,
input_lines = TRUE,
graticule = TRUE,
expand = 0.05,
contours = FALSE,
levels = c(-500, -1000, -2000),
ppch = 19,
pcol = 2,
pcex = 1,
bathyleg = FALSE,
llty = 1,
llwd = 1,
lcol = 1,
gratlon = NULL,
gratlat = NULL,
gratpos = "all",
...
)
optional input data longitudes. x
can also be a Raster
or Spatial
object, in which case the extent of x
will be used for the map, but note that the contents of x
will not be plotted automatically (use SOplot
to do so)
optional input data latitudes
optional centre longitude (of the map projection, also used to for plot range if expand = TRUE
)
as per centre_lon
optional projection family (default is stere
ographic), or full PROJ string (see Details)
dimensions of background bathmetry (if used), a default is provided
logical: if TRUE
, plot bathymetry. Alternatively, provide the bathymetry data to use as a Raster
object
logical: if TRUE
, plot coastline. Alternatively, provide the coastline data to use as a Spatial
object
character: colour to use for plotting the coastline
logical: if TRUE
, plot ice features (ice shelves, glacier tongues, and similar)
character: colour to use for ice features
add points to plot (of x, y)
add lines to plot (of x, y)
flag to add a basic graticule
fraction to expand plot range (default is 0.05, set to zero for no buffer, may be negative)
logical: add contours?
numeric: contour levels to use if contours
is TRUE
set point character (default=19)
set point color (default=19)
set point cex (default=1)
optional bathymetry legend (default=FALSE)
set line type
set line width
set line color
longitude values for graticule meridians
latitude values for graticule parallels
positions (sides) of graticule labels
reserved, checked for defunct and deprecated usage
An object of class SOmap_auto, containing the data and other details required to generate the map. Printing or plotting the object will cause it to be plotted.
To input your data, use input locations as x
(longitude) and y
(latitude) values. There must be at least two locations. The x
input object can also be provided as a Raster
or Spatial
object, in which case the extent of x
will be used for the map, but note that the contents of x
will not be plotted automatically (use SOplot
to do so).
Try target
families such as 'lcc', 'laea', 'gnom', 'merc', 'aea' if feeling adventurous.
if (FALSE) { # \dontrun{
SOmap_auto(c(0, 50), c(-70, -50))
SOmap_auto(runif(10, 130, 200), runif(10, -80, -10))
SOplot(c(147, 180), c(-42, -60), pch = 19, cex = 2,col = "firebrick")
SOmap_auto(runif(10, 130, 200), runif(10, -85, -60))
## save the result to explore later!
protomap <- SOmap_auto(runif(10, 60, 160), runif(10, -73, -50))
SOmap_auto(runif(50, 40, 180), runif(50, -73, -10), family = "laea", centre_lat = -15,
input_lines = FALSE)
} # }