# plot.cobs: Plot Method for COBS Objects In cobs: Constrained B-Splines (Sparse Matrix Based)

## Description

The `plot` method for `cobs` objects. If there was `lambda` selection, it provides two plots by default.

## Usage

 ```1 2 3 4 5 6 7 8 9``` ```## S3 method for class 'cobs' plot(x, which = if(x\$select.lambda) 1:2 else 2, show.k = TRUE, col = par("col"), l.col = c("red","pink"), k.col = gray(c(0.6, 0.8)), lwd = 2, cex = 0.4, ylim = NULL, xlab = deparse(x\$call[]), ylab = deparse(x\$call[]), main = paste(deparse(x\$call, width.cutoff = 100), collapse="\n"), subtit= c("choosing lambda", "data & spline curve") , ...) ```

## Arguments

 `x` object of class `cobs`. `which` integer vector specifying which plots should be drawn;
 `show.k` logical indicating if the “effective dimensionality” k should also be shown. Only applicable when `which` contains 1. `col, l.col, k.col` colors for plotting; `k.col` only applies when `show.k` is true in the first plot (```which == 1```) where `l.col` and `k.col` are only used as well, for denoting “doubtful” points; `col` is only used for the 2nd plot (`which == 2`). `lwd, cex` line width and point size for the 2nd plot (i.e. `which == 2`). `ylim` y-axis limits, see `axis`, with a smart default. `xlab, ylab, main` axis annotation; see also `axis`. `subtit` a vector of length 2, specifying a sub title for each plot (according to `which`). `...` further arguments passed and to internal `plot` methods.

## Details

`plot(.)` produces two side-by-side plots in case there was a search for the optimal lambda(`which = 1:2`), and only the (second) data plus spline curve plot otherwise (`which = 2`).

## Author(s)

Martin Maechler

There are several other methods for COBS objects, see, e.g. `summary.cobs` or `predict.cobs`.
`cobs` for examples.
 ```1 2 3 4 5 6``` ```example(cobs) plot(Sbs) plot(fitted(Sbs), resid(Sbs), main = "Tukey-Anscombe plot for cobs()", sub = deparse(Sbs\$call)) ```