Draws one or several line series using graphics::matplot().
The function accepts either a matrix of values or separate x and
y coordinates and supports optional point symbols, grid lines,
and an automatically positioned legend.
Usage
plotLines(
x,
y,
main = NULL,
xlab = "",
ylab = "",
xlim = NULL,
ylim = NULL,
xaxt = NULL,
yaxt = NULL,
lty = 1,
lwd = 2,
col = .useTheme,
points = FALSE,
grid = .useTheme,
legend = TRUE,
stamp = .useTheme,
...
)Arguments
- x
numeric vector, matrix or data frame. If
yis missing,xis interpreted as a matrix of series where rows correspond to x positions and columns to individual lines.- y
optional numeric vector or matrix giving the y-values. If supplied,
xis interpreted as the x-coordinates.- main
main title of the plot.
NULL(default) derives a title from the input."",NA, orFALSEsuppress the title and compact the top margin.- xlab, ylab
labels for the axes.
- xlim, ylim
limits for the axes.
- xaxt, yaxt
axis specification passed to
graphics::axis().- lty
line type(s).
- lwd
line width(s).
- col
colours for the lines.
.useTheme(default) resolves topal(getTheme()$palette), the active theme's qualitative palette.- points
controls drawing of points on the lines.
FALSE(default) suppresses points;TRUEdraws with theme defaults (getTheme()$points); a named list overrides individual elements (pch,col,bg,cex).- grid
controls drawing of the background grid.
.useTheme(default) follows the active theme (getTheme()$grid).TRUE/FALSE/NA, or a named list, as forgraphics::grid().- legend
controls the legend.
TRUE(default) draws an inline legend viatextLegendat the last value of each series.FALSE/NAsuppresses it. A list overrides legend arguments.- stamp
controls the corner stamp.
.useTheme(default) resolves togetTheme()$stamp.TRUE/FALSE/NULL, a string, or a named list forstamp().- ...
additional graphical parameters passed to
graphics::par()via.applyParFromDots()and to the plotting functions.
Value
Invisibly returns a list containing:
xthe x-values used for plotting,ythe y-values (if supplied),legendthe legend specification if drawn.
Details
If y is missing, x is interpreted as a matrix and each column
is drawn as a separate line. Row names are used for the x-axis labels if
available. The legend labels default to the column names of the data.
See also
Other plot.univariate:
plotArea(),
plotBar(),
plotBox(),
plotCatDist(),
plotDens(),
plotDensBox(),
plotDot(),
plotECDF(),
plotFdist(),
plotQQ(),
plotViolin()



