[R] Adding horizontal lines to Boxplot

Klaus Friis Østergaard farremosen at gmail.com
Fri Oct 19 11:24:23 CEST 2007


2007/10/19, Frede Aakmann Tøgersen <FredeA.Togersen at agrsci.dk>:
>
> So where is the reproducable example?
>
> How can we know that you're not doing
>
> boxplot(1:10)
> abline(h = 400, col = "red")?
>
> best regards
>
> Frede


You are right, a  reproducable example  should have been there.

I don't know what I mistyped but  I got to work and here is an example that
works,

boxplot(3.2:5.2, 1.9:3.9,3.9:5.9)
abline(h = 4)
abline(h = 2.5, col = "green")
abline(h = 2, col = "red")
abline(h = 5.5, col = "green")
abline(h = 6, col = "red")

I also tested with the lwd parameter of the abline

 boxplot(3:5, 2:4,4:6)
 abline(h = 4)
 abline(h = 2.5, col = "red", lwd = 2)
 abline(h = 5.5, col = "red", lwd = 2)

Is it possible to scale the size of the boxplot, so that scale on the Y axis
is say from 0 to 8 instead of 2 to 6 as it is in the example from above.



-- 
Klaus F. Østergaard, <farremosen(at)gmail dot com>


More information about the R-help mailing list