An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120628/580b5b15/attachment.pl>
custom graphing of box and whisker plots
4 messages · Brianna Wright, Mark Difford, briannamwright +1 more
On Jun 28, 2012 at 9:08pm Brianna Wright wrote:
I'm trying to graph some data in a boxplot-like style, but I want to set the box and whisker limits myself...
See ?bxp and ?boxplot for the format of the data you need to pass to bxp. (You just have to add the median to what you have provided in your example.) Regards, Mark. ----- Mark Difford (Ph.D.) Research Associate Botany Department Nelson Mandela Metropolitan University Port Elizabeth, South Africa -- View this message in context: http://r.789695.n4.nabble.com/custom-graphing-of-box-and-whisker-plots-tp4634826p4634845.html Sent from the R help mailing list archive at Nabble.com.
Hi Mark, Thanks for your help - I took a look at ?bxp and ?boxplot. I guess I'm just uncertain about how to specify "z" in bxp(), not sure I'm quite understanding how the function works. Thanks, Brianna -- View this message in context: http://r.789695.n4.nabble.com/custom-graphing-of-box-and-whisker-plots-tp4634826p4634917.html Sent from the R help mailing list archive at Nabble.com.
On 2012-06-29 11:09, briannamwright wrote:
Hi Mark, Thanks for your help - I took a look at ?bxp and ?boxplot. I guess I'm just uncertain about how to specify "z" in bxp(), not sure I'm quite understanding how the function works.
Just generate the list; see the Value section in ?boxplot.
It seems that all you need is a list consisting of two
components: 'stats', a matrix of the relevant numbers,
and 'names'. Use your data to construct a 5-row, 3-column
matrix. Each column should have, _in the appropriate order_,
the 5 values listed on the help page for boxplot. Your
original post did not specify medians; just make up any
number that falls inside the box and use a transparent
colour for the median line in the plot.
Say you call your matrix M. Then
z <- list(stats = M, names = c("A", "B", "C"))
can be fed to bxp:
bxp(z, medcol = 0, whisklty = "dotted", boxfill = "green")
for example.
Peter Ehlers
Thanks, Brianna -- View this message in context: http://r.789695.n4.nabble.com/custom-graphing-of-box-and-whisker-plots-tp4634826p4634917.html Sent from the R help mailing list archive at Nabble.com.