Re: [R] Plot question

From: Mark Difford <mark_difford_at_yahoo.co.uk>
Date: Fri, 14 Dec 2007 06:25:28 -0800 (PST)

Hi Alan,

Yes it is, but you need to do a bit work. There are different approaches. Look at the at= option under

?bxp

and draw your boxplots with something like:

boxplot(y ~ as.numeric(as.factor(grp)), at=c(0.5, 2, 2.5, 3), xaxt="n", ...) axis(side=1, at=c(0.5, 2, 2.5, 3), labels=c("0.5","2","2.5","3"))

This should do it, and is perhaps the easiest route. There may be something missing, because I don't have a concrete example. Anyhow, you should be able to fill in the gaps.

HTH, Mark.

Alan Barnett wrote:
>
> I have some data consisting of multiple trials of an experiment with
> different values of an independent variable. If I run
> R> plot(var,result)
> I get a scatterplot of result versus the independent variable var.
> If I run
> R> plot(as.factor(var),result)
> I get a boxplot of the distribution of result for each value of var. In
> this plot, each boxplot is labeled by the corresponding value of var,
> but the absissas are evenly spaced.
> Is it possible to generate a boxplot with the absissas of each boxplot
> equal to the corresponding value of var?
>
> --
> Alan Barnett, PhD
> Imaging Physicist
> National Institutes of Health
> NIMH/CBDB
> 301 402 3507
>
> ______________________________________________
> R-help_at_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.
>
>

-- 
View this message in context: http://www.nabble.com/Plot-question-tp14335709p14336622.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Fri 14 Dec 2007 - 14:38:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 14 Dec 2007 - 15:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.