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, ...)
panel.abline(v = 0, ...)
}
)
Gustaf Rydevik a écrit
> 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 coordinate system. What kind of call
> do I use to make abline use the graph's coordinates?
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.