[R] Need help putting histograms on the diagonal of a splom plot
paterno at fnal.gov
Fri Aug 31 01:37:08 CEST 2007
I am in need of help in putting histograms on the diagonal of a plot
produced with splom().
The plot matrix I am trying to produce is to have standard scatterplots
in the upper-left triangle, contour plots in the lower-right triangle,
and histograms on the diagonal. I have a function that does the first
two, but the histograms on the diagonal has been beyond my ability.
Here is my function:
my.plot = function(data)
, lower.panel=function(x,y, ...)
, labels = FALSE
, col.regions = terrain.colors
, upper.panel=function(x,y, ...)
#, diag.panel=function(x, ...)
# panel.histogram(x, ...)
It can be called, for example, with:
my.plot(subset(iris, select = Sepal.Length:Petal.Width))
(the subset is necessary to get rid of a variable that is a factor; my
function can not deal with factors).
I have commented out my best guess at the code needed to produce the
histograms along the diagonal, which fails.
Any guidance would be greatly appreciated.
More information about the R-help