BJ
2005-May-25 20:31 UTC
[R] Any ideas on how to add a dotted line to a box plot to indicate a specific value?
Basically, i want to create a boxplot from population data, with a solid line for the median, and then a dotted line for a specific persons value. Is there a way to artificially introduce another line or mark of some kind in a box plot? Thanks again for all of yoru help. Hopefully soon I wont have to keep bugging you all. ~Erithid :-p
Paul Murrell
2005-May-25 23:54 UTC
[R] Any ideas on how to add a dotted line to a box plot to indicate a specific value?
Hi BJ wrote:> Basically, i want to create a boxplot from population data, with a solid > line for the median, and then a dotted line for a specific persons > value. Is there a way to artificially introduce another line or mark of > some kind in a box plot? Thanks again for all of yoru help. Hopefully > soon I wont have to keep bugging you all. ~Erithid :-pDo you mean something like this ... ? with(ToothGrowth, { boxplot(len ~ supp) # boxplots horizontally centred at 1 and 2 # 0.6, 1.4 come from default boxwex of 0.8 # (1 +/- boxwex/2) # 18 I made up lines(c(0.6, 1.4), c(18, 18), lty="dashed", col="red") }) Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/
vincent
2005-May-26 07:20 UTC
[R] Any ideas on how to add a dotted line to a box plot to indicate a specific value?
lines(...) could perhaps be useful ? hih
BJ
2005-May-26 15:31 UTC
[R] Any ideas on how to add a dotted line to a box plot to indicate a specific value?- Thank you all for your help
Lots of good ideas, and great advice! Thank you as always ~Erithid vincent wrote:> lines(...) could perhaps be useful ? > hih > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >