# Plot Columns of Matrices in Grid Viewport

### Description

Similar to `matplot`

function, but drawn in grid viewport:
Plot the columns of one matrix against the columns of another.

### Usage

1 2 |

### Arguments

`x,y` |
vectors or matrices of data for plotting. The number of rows
should match. If one of them are missing, the other is taken
as |

`type` |
* * * |

`lty,lwd` |
vector of line types and widths. The first element is for the first column, the second element for the second column, etc., even if lines are not plotted for all columns. Line types will be used cyclically until all plots are drawn. |

`pch` |
character string or vector of 1-characters or integers for
plotting characters, see |

`col` |
vector of colours. Colours are used cyclically. |

`cex` |
vector of character expansion sizes, used cyclically. This
works as a multiple of |

`xlim,ylim` |
ranges of x and y axes, as in |

`...` |
Graphical parameters (see |

### Details

Points involving missing values are not plotted.

The first column of `x`

is plotted against the first column of
`y`

, the second column of `x`

against the second column of `y`

,
etc. If one matrix has fewer columns, plotting will cycle back
through the columns again. (In particular, either `x`

or `y`

may
be a vector, against which all columns of the other argument will
be plotted.)

Because plotting symbols are drawn with lines and because these
functions may be changing the line style, you should probably
specify `lty=1`

when using plotting symbols.

### Author(s)

Original code by the R Core development team. Modified by Ingo Voglhuber.

### See Also

`gbarplot`

, `gpie`

,
`gstars`

, `gsymbols`

,
`gbxp`

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
require(grDevices)
grid.newpage()
grid.rect()
gmatplot((-4:5)^2)
grid.newpage()
sines <- outer(1:20, 1:4, function(x, y) sin(x / 20 * pi * y))
grid.rect()
gmatplot(sines, pch = 1:4, type = "o",
col = rainbow(ncol(sines)))
grid.newpage()
grid.rect()
gmatplot(sines, type = "l", pch = 21:23, col = 2:5)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.