slContour: Level (Contour) Plots (modified version)

Description Usage Arguments Author(s) References See Also Examples

Description

The function is a modified version of filled.contour, with an additional option to show the given values as color image without interpolation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  slContour(x = seq(0, 1, len = nrow(z)),
            y = seq(0, 1, len = ncol(z)),
            z,
            xlim = range(x, finite=TRUE),
            ylim = range(y, finite=TRUE),
            zlim = range(z, finite=TRUE),
            levels = pretty(zlim, nlevels), nlevels = 20,
            color.palette = cm.colors,
            col = color.palette(length(levels) - 1),
            plot.title, plot.axes, key.title, key.axes,
            asp = NA, xaxs = "i", yaxs = "i", las = 1, axes = TRUE,
            smooth = TRUE,
            drawlines = TRUE,
            drawlabels = TRUE, 
            ...)

Arguments

x,y

locations of grid lines at which the values in z are measured. These must be in ascending order. By default, equally spaced values from 0 to 1 are used. If x is a list, its components x$x and x$y are used for x and y, respectively. If the list has component z this is used for z.

z

a matrix containing the values to be plotted (NAs are allowed). Note that x can be used instead of z for convenience.

xlim

x limits for the plot.

ylim

y limits for the plot.

zlim

z limits for the plot.

levels

a set of levels which are used to partition the range of z. Must be strictly increasing (and finite). Areas with z values between consecutive levels are painted with the same color.

nlevels

if levels is not specified, the range of z, values is divided into approximately this many levels.

color.palette

a color palette function to be used to assign colors in the plot.

col

an explicit set of colors to be used in the plot. This argument overrides any palette function specification.

plot.title

statements which add titles the main plot.

plot.axes

statements which draw axes on the main plot. This overrides the default axes.

key.title

statements which add titles for the plot key.

key.axes

statements which draw axes on the plot key. This overrides the default axis.

asp

the y/x aspect ratio, see plot.window.

xaxs

the x axis style. The default is to use internal labeling.

yaxs

the y axis style. The default is to use internal labeling.

las

the style of labeling to be used. The default is to use horizontal labeling.

smooth

logical. If false the filled areas are not smoothed, so showing only, what was really measured.

drawlines

logical. Switches the smooth contour lines on and off.

drawlabels

logical. Contours are labelled if true

axes, ...

additional graphical parameters.

Author(s)

Ross Ihaka. (slightly modified version by Susanne Rolinski and Thomas Petzoldt)

References

Cleveland, W. S. (1993) Visualizing Data. Summit, New Jersey: Hobart.

See Also

filled.contour, contour, image, palette.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  data(tProfile)
  day          <- tProfile$day
  depth        <- 0:10
  tProfile$day <- NULL         # delete column
  newdat       <- NULL
  newday       <- seq(0,365,1) # Interpolation with 1 day interval

  for (i in 1:ncol(tProfile)) {
      newtemp <- approx(day, tProfile[,i], newday)$y
      newdat  <- cbind(newdat, newtemp)
  }

  slContour(x=newday,
            y=depth,
            as.matrix(newdat),
            ylim=c(max(depth),0),           # revert y-scale (depth)
            levels=seq(0,24,2),             # 0 ... +2 ... 26 °C
            col=rev(rainbow(n=13,end=0.7)), # color scale
            xlab="Julian Day",
            ylab="Depth (m)",
            key.title=title("T (°C)"),
            smooth=FALSE,
            drawlines=TRUE
           )

rsachse/limnotools documentation built on Jan. 8, 2021, 5:37 a.m.