[R] Re : Re : Adding mean line to a lattice density plot
kridox at ymail.com
Thu Mar 8 15:09:54 CET 2012
Unfortunately, I can't visualize the attachment. Could you provide an example I can reproduce?
----- Mail original -----
De : K. Elo <maillists at nic.fi>
À : r-help at r-project.org
Envoyé le : Jeudi 8 mars 2012 22h38
Objet : Re: [R] Re : Adding mean line to a lattice density plot
thank you, Pascal, for your quick reply. Unfortunately your suggestion is not working. Please have a look on the attachment, I have added manually the mean lines I am trying to plot. The problem with 'abilne' seems to be that the argument 'v' is relative to the graph area, not the x-axis scale. Thus, plottingat v='mean' won't work...
08.03.2012 09:49, Pascal Oettli wrote:
> Hi Kimmo,
> You can try to use the "layer" function from "latticeExtra" library:
> densityplot(~PV1CIV, groups=SGENDER, data=ISGFINC2,
> lwd=2, col=1, lty=c(1,2), pch=c("+","o"),
> key=list(text=list(lab=levels(ISGFINC2$SGENDER), col=1),
> space="bottom", columns=2, border=T, lines=T, lwd=2,
> lty=c(1,2), col=1), ref=T, plot.points=F) + layer(panel.abline(v=mean(PV1CIV[ SGENDER==1 ])))
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help