Re: [R] Vertical line in densityplot?

2006-12-01 Thread Gustaf Rydevik
On 12/1/06, Thomas Petzoldt [EMAIL PROTECTED] wrote: Hi, lattice graphics work by utilizing so called panel functions. Here is a working version of your example: library(lattice) x-rnorm(100) plot.new() densityplot(x, panel=function(x, ...){ panel.densityplot(x, ...)

[R] Vertical line in densityplot?

2006-11-30 Thread Gustaf Rydevik
Hi all, I'm trying to get a vertical line at a specific point in a densityplot. abline seems to be what's required, but it doesn't align itself to the scale used in the plot. example: library(lattice) x-rnorm(100) plot.new() densityplot(x) abline(v=0) - The line seems to use some other

[R] Vertical line in densityplot?

2006-11-30 Thread Ken Knoblauch
I think that you are mixing lattice and base graphics. This works for me: library(lattice) x-rnorm(100) densityplot(x, panel = function(x, ...) { panel.densityplot(x, ...)

Re: [R] Vertical line in densityplot?

2006-11-30 Thread Thomas Petzoldt
Hi, lattice graphics work by utilizing so called panel functions. Here is a working version of your example: library(lattice) x-rnorm(100) plot.new() densityplot(x, panel=function(x, ...){ panel.densityplot(x, ...) panel.abline(v=0) } ) For mor information, please look into