Learn R Programming

scuba (version 1.11-1)

plot.dive: Plot a Dive Profile

Description

Plot a dive profile.

Usage

# S3 method for dive
plot(x, ..., main=deparse(substitute(x)),
                        key.gases=c("text", "legend", "none"),
                        text.cex=1,
                        text.verticals=TRUE,
                        col.gases=1:length(tanklist(x)),
                        legendpos=c("top","bottom", "left", "right",
                        "topleft", "topright", "bottomleft", "bottomright",
                        "center"))

Value

NULL.

Arguments

x

The dive profile. An object of class "dive" created by dive.

...

Arguments passed to plot.default.

main

Overall label for plot.

key.gases

String indicating whether the plot should be annotated with labels indicating what gas is breathed, and how to do the annotation.

text.cex

Numeric value controlling the size of text when key.gases="text".

text.verticals

Logical flag indicating whether the plot should indicate what gas is breathed during ascent and descent between stages, as well as during the main stages of the dive.

col.gases

Colours to be used to represent each of the breathing gases used in the dive. Either a numeric vector of colour codes, or a vector of character strings identifying colours.

legendpos

Character string determining the position of the legend, when key.gases="legend". Default is "top".

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

Details

A representation of the dive profile is plotted.

See Also

dive

Examples

Run this code
  # Dive to 25 m for 20 min with safety stop
  d1 <- dive(c(25,20),c(5,5))
  # plot it
  plot.dive(d1)
  # Dive to 18 m for 30 min with safety stop, on Nitrox EANx 36
  d3 <- dive(nitrox(0.36), c(18,30), c(5,3))
  plot.dive(d3)
  # Real dive profile
  data(baron)
  d4 <- dive(nitrox(0.30), baron[, 1:2])
  plot(d4, main="Baron Gautsch dive")

Run the code above in your browser using DataLab