plot_GIS: Plot GIS shape files

View source: R/plot_GIS.R

plot_GISR Documentation

Plot GIS shape files

Description

This function can be used to plot gis data that has been loaded from shape files using the readShapePoly() function contained in the 'maptools' R package.

Usage

plot_GIS(
  gis_data = NULL,
  main = "",
  xlab = "",
  ylab = "",
  xlim = NULL,
  ylim = NULL,
  show.axis = TRUE,
  show.grid = TRUE,
  grid.div = 1,
  round.grid = FALSE,
  grid.col = "grey",
  fill.col = NA,
  line.col = NULL,
  bg.col = "white",
  box.col = NA,
  new.window = TRUE,
  no.margin = FALSE,
  set.margin = TRUE,
  max.dimen = 13,
  cex.main = 1.2,
  cex.lab = 1,
  cex.axis = 0.8,
  blank.plot = FALSE,
  plot.shape = TRUE,
  additions = FALSE,
  return.dimen = TRUE
)

Arguments

gis_data

GIS object, or list of objects, to be plotted.

main

Text variable controlling the main title placed on the plot - value needs to be a text string (default == ”, title is blank)

xlab

Text variable controlling the label for the x-axis - value needs to be a text string (default = "", blank)

ylab

Text variable controlling the label for the y-axis - value needs to be a text string (default = "", blank)

xlim

Numberical variable setting the lower and upper limits for the x-axis. xlim can be rounded to nearest grid divison (controlled by grid.div and round.grid) that allows the specified coordinates to be plotted (default = NULL, fixs the limits to the nearest grid line (see grid.divs) that allows all GIS shapes to be plotted)

ylim

Numberical variable setting the lower and upper limits for the y-axis. ylim can be rounded to the nearest grid divison (controlled by grid.div and round.grid) that allows the specified coordinates to be plotted (default = NULL, fixs the limits to the nearest grid line (see grid.divs) that allows all gis shapes to be plotted)

show.axis

Logical variable controlling whether axis are plotted

show.grid

Logical variable determining whether to overlay gridlines ontop on the plot

grid.div

Numerical variable determining the interval between axis ticks and also the gridlines. Note: when show.grid = TRUE this value still determines the axes tick intervals (default = 1)

round.grid

Logical, if TRUE the bounding box is enlarged so that that entire grid cells are shown (default = FALSE)

grid.col

Variable determining the colour of the lines used for the overlaid grid. Value can be text string of a named colour, numerical value, etc, see help for function 'par' for more details (default = "grey").

fill.col

Variable determining the colour used to fill the landmasses plotted. Value can be text string of a named colour, numerical value, etc, see help for function 'par' for more details (default = NA, meaning no fill)

line.col

Variable determining the colour of the line used to plot the landmasses. Value can be text string of a named colour, numerical value, etc, see help for function 'par' for more details (default = NULL, which results in black lines)

bg.col

Variable determining the colour of the background of the plot area. Value can be text string of a named colour, numerical value, etc, see help for function 'par' for more details (default = "white")

box.col

Variable determining the colour of the border surrounding the plot area (default = NA, no border is added to plot)

new.window

Logical variable determining whether plot should create and plot in a new window or plot within an existing window/device. NOTE: when new.window = TRUE the window dimensions are determined based upon the xlim and ylim in order to keep the correct aspect ratio and preserve the map shape, if changing new.window to FALSE the sizing of the device/window is down the the user/previous plot (default TRUE)

no.margin

Logical variable determining whether plot should include a margin NOTE - main title, x-labels and y-labels are written in margin so do not remove margin if titles/labels are required (default = FALSE, plot includes a margin).

set.margin

Logical variable. If TRUE (default), the margins are set to be of equal size. If FALSE the margins are used as set in the R environment.

max.dimen

Numberical variable determining the maximum window dimension. Variable determines height or width depend on whether xlim range is greater than ylim range (default = 13)

cex.main

Numberical variable determining the relative sizing of the main plot title (default = 1.2)

cex.lab

Numberical variable determining the relative sizing of the axis labels (default = 1)

cex.axis

Numberical variable determining the relative sizing of the axis values (default = 0.8)

blank.plot

Logical variable determining whether function should finish once blank plot window created or if it should continue further with the plotting (default = FALSE, plotting continues)

plot.shape

Logical variable determining whether to plot lines from shape file or whether to only setup the background of the plot (i.e grid lines, axis) to which outline can be added later, useful where outline is to cover plotting symbols/colours (default = TRUE)

additions

Logical variable determining whether plot is to be created from scratch or whether components (i.e. axes, gridlines, outline) are to be added to an existing plot (default = FALSE)

return.dimen

logical, if TRUE the plot dimensions are returned

Value

A data.frame giving the dimensions of the plot area.


BiologicalRecordsCentre/sparta documentation built on April 12, 2024, 2:10 a.m.