mdaplotyy function

Create line plot with double y-axis

Create line plot with double y-axis

mdaplotyy create line plot for two plot series and uses separate y-axis for each.

mdaplotyy( data, type = "l", col = mdaplot.getColors(2), lty = c(1, 1), lwd = c(1, 1), pch = (if (type == "b") c(16, 16) else c(NA, NA)), cex = 1, xlim = NULL, ylim = NULL, main = attr(data, "name"), xlab = attr(data, "xaxis.name"), ylab = rownames(data), labels = "values", show.labels = FALSE, lab.cex = 0.65, lab.col = "darkgray", show.grid = TRUE, grid.lwd = 0.5, grid.col = "lightgray", xticks = NULL, xticklabels = NULL, xlas = 0, ylas = 0, show.legend = TRUE, legend.position = "topright", legend = ylab, ... )

Arguments

  • data: a matrix or a data.frame with two rows of values.
  • type: type of the plot ("l" or "b").
  • col: a color for markers or lines (same as plot parameter) for each series.
  • lty: line type for each series (two values)
  • lwd: line width for each series (two values)
  • pch: a character for markers (same as plot parameter) for each series (two values).
  • cex: scale factor for the markers
  • xlim: limits for the x axis (if NULL, will be calculated automatically).
  • ylim: limits for the y axis, either list with two vectors (one for each series) or NULL.
  • main: an overall title for the plot (same as plot parameter).
  • xlab: a title for the x axis (same as plot parameter).
  • ylab: a title for each of the two y axis (as a vector of two text values).
  • labels: a vector with text labels for data points or one of the following: "names", "indices", "values".
  • show.labels: logical, show or not labels for the data objects.
  • lab.cex: size for data point labels.
  • lab.col: color for data point labels.
  • show.grid: logical, show or not a grid for the plot.
  • grid.lwd: line thinckness (width) for the grid.
  • grid.col: line color for the grid.
  • xticks: values for x ticks.
  • xticklabels: labels for x ticks.
  • xlas: orientation of xticklabels.
  • ylas: orientation of yticklabels (will be applied to both y axes).
  • show.legend: logical show legend with name of each plot series or not
  • legend.position: position of legend if it must be shown
  • legend: values for the legend
  • ...: other plotting arguments.

Details

This plot has properties both mdaplot and mdaplotg, so when you specify color, line properties etc. you have to do it for both plot series.

Examples

# See all examples in the tutorial.

See Also

mdaplotg - to make plots for several sets of data objects (groups of objects).

Author(s)

Sergey Kucheryavskiy (svkucheryavski@gmail.com)

  • Maintainer: Sergey Kucheryavskiy
  • License: MIT + file LICENSE
  • Last published: 2024-08-19