plotHeatmapComparison {paleoAM}R Documentation

Plots a Heatmap Comparison

Description

This function is a complex wrapper of the functions contour and filled.contour which allows a user to combine colored contours for the surface of a third variables plotted across a two-dimensional space, with contour lines of the third variable's surface also plotted in that same two-dimensional space. This is often a common plotting need for this package, and thus is included here.

Usage

plotHeatmapComparison(
  x,
  y,
  z,
  xlim = range(x, finite = TRUE),
  ylim = range(y, finite = TRUE),
  zlim = range(z, finite = TRUE),
  xlog = FALSE,
  ylog = FALSE,
  xtick = pretty(x),
  ytick = pretty(y),
  contourLevels = NULL,
  nlevels = 10,
  contourLineLevels = NULL,
  contour.lwd = 2,
  additionalFeatures = NULL,
  palette = "plasma",
  xlab = "x",
  ylab = "y",
  main = "main title",
  gradientKeyLabel = "color gradient key",
  mtext_line = 3,
  margins = c(5, 6, 5, 5)
)

Arguments

x, y

The horizontal (x) and vertical (y) variables that determine the two-dimensional space within which the third variable (z) is plotted as a surface.

z

The values of the third variable (z) that will be used to define the plotted surface for contours, given as a matrix with the same number of rows as the length of x, and the same number of columns as the length of y.

xlim, ylim, zlim

These are two-element vectors giving the minimum and maximum limits for the horizontal variable (x), vertical variable (y), and the variable defining the surface plotted (z) within the two dimensional space defined by x and y.

xlog, ylog

Should the x or y axes be displayed with log-scaling?

xtick, ytick

Vectors that give the positions of the tick-marks for x and y axes.

contourLevels

A vector of values at which to put the breaks between the color-filled contours for z, Also determines the different levels show on the color-gradient key shown to the side of the contour plot.

nlevels

The number of different color levels to use, if contourLevels is not defined.

contourLineLevels

A vector of values at which to put the distinct contour lines for z. This must be defined for contour lines to be plotted.

contour.lwd

The thickness of plotted contour lines.

additionalFeatures

Additional features to add to the contour space, such as

palette

The color palette to use for filled.contour. By default, the palette "plasma" is used.

xlab, ylab

The labels for the x and y axes.

main

The plot's main title.

gradientKeyLabel

The optional label text for the color gradient key for z, shown to the right of the main contour plot. This label will be shown to the right of the key.

mtext_line

The distant in the margin away from the key at which the gradientKeyLabel is displayed. The default value is 3.

margins

The size of the margins for the result plot. The default configuration gives some extra room on the left-hand size.

Details

The function filled.contour doesn't easy allow for sequential modifications, like adding additional contour lines to an existing contour plot, and so this function simplifies having to write the second contour plot as an argument for plot.axes in filled.contour.

Value

This function returns nothing at all as output. It just makes a plot.


[Package paleoAM version 1.0.1 Index]