Dear R users, 

I hope you can help me as you have done before. 

I was wondering if I can make some of the points on my graph a different colour 
and symbol? Some of my soil samples are enriched and I wanted them to be shown 
with a red triangle and the samples which are not enriched I wanted to show 
with a blue square. I can't seem to find a way of doing this if there is a way? 

My script:

           x
<- c(0, 50, 100, 250, 500, 750, 1000, 1500, 2000, 2500, 3000)
           y
<- c(450, 109, 27,21,206,138,97,185,77,670,80)
plot     (y~x,
xaxt = "n", type = "p", xlab = "Distance (m)",
ylab = "Concentrations (mg/kg)", cex.axis = .8, xlim = c(0,3000),
ylim = c(0,800), col =2, pch = 17,                bg = 2, sub = "Zinc",
font.sub = 2)
            abline(h=c(63),
lty = 2, col = "green", lwd =1)
            abline(h=c(140),
lty = 3, col = "blue", lwd = 1)
             abline(h=c(720),
lty = 1, col ="red", lwd = 2)
             legend(1300,
700, c("Control", "Dutch List - Optimum", "Dutch List
- Action"), col = c(3,4,2), lty = c(2,3,1), cex = 0.8, lwd = c(1,1,2),
inset = 1)
             axis(1,
at = x, cex.axis=.7, las=2) 
             text(0,450,
"mine average", pos = 4, col = "black", cex= 0.8)

            If possible I would like coordinates (100, 27) and (250, 21) to be 
shown as blue squares (col = 4, bg = 4, pch = 15). 

Hope you can help!
Lauren
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to