plot.density.contours | R Documentation |
Contour plot of one ore more bivariate densities. This function was originally created to implement PairsDensity, but might be useful on its own.
PlotDensityContours(draws, x.index = 1, y.index = 2, xlim = NULL, ylim = NULL, nlevels = 20, subset = NULL, color = NULL, lty = NULL, axes = TRUE, ...)
draws |
Either a matrix or a list of matrices. If a list is provided then each list element is plotted as a separate set of contours, and all matrices must have the same number of columns (though the number of rows can differ). |
x.index |
The index of the parameter to plot on the horizonal axis. |
y.index |
The index of the beta coefficient to plot on the vertical axis. |
xlim |
Limits on the horizontal axis. If NULL then the plot is just wide enough to fit the contours. |
ylim |
Limits on the vertical axis. If NULL then the plot is just tall enough to fit the contours. |
nlevels |
The number of contour levels to plot. |
subset |
If draws is a list, then this can be a numerical vector.
If draws has names, then subset can be a character vector naming
which elements to include. If |
color |
The color to use for different elemetns in |
lty |
The line types to use for the different elements in
|
axes |
Logical. Should x and y axies be drawn? |
... |
Extra arguments passed to |
Steven L. Scott
contour
, kde2d
## You can see the pairs plot for a single set of draws. y <- matrix(rnorm(5000, mean = 1:5), ncol = 5, byrow = TRUE) PlotDensityContours(y, 3, 1) ## You can also compare two or more sets of draws. z <- matrix(rnorm(2500, mean = 2:6), ncol = 5, byrow = TRUE) PlotDensityContours(list("first set" = y, "second set" = z), 3, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.