#[R] panel.first won't work in plot()

2 messages · Page 1 of 1 (latest)

shadow bobcat
#

About the language R: If I plot the elements separately it's almost exactly as I want, as in

plot(Pression ~ Age, data=l10_1_debut_donnees,
    ylim=c(floor(min(l10_1_e_predit_resultat$inf95)),
        ceiling(max(l10_1_e_predit_resultat$sup95))),
    xlab="mm de Hg", ylab="Années", main="Pression sanguine chez des patients de différents âges")
        arrows(x0=55,
            y0=l10_1_d_inf95,
            y1=l10_1_d_sup95, 
            x1=55,
            length = 0, col="gray")
        points(55, l10_1_d_resultat, col="gray")

with the exception it's over the other content. However, when I try integrate the 2nd & 3rd element of the previous code in a panel.first so it's behind, it won't work, as in

plot(Pression ~ Age, data=l10_1_debut_donnees,
    ylim=c(floor(min(l10_1_e_predit_resultat$inf95)),
        ceiling(max(l10_1_e_predit_resultat$sup95))),
    xlab="mm de Hg", ylab="Années", main="Pression sanguine chez des patients de différents âges",
    panel.first=c(
        arrows(x0=55,
            y0=l10_1_d_inf95,
            y1=l10_1_d_sup95, 
            x1=55,
            length = 0, col="gray"),
        points(55, l10_1_d_resultat, col="gray")))

I also tried with both elements of panel.first separatly in vain (thus removed them from the c() ). panel.first works just fine in qqnorm(), as well as in plot() of both an aov() and lm(). How can I fix the panel.first for this case?