[R] scatterplot x axis specifications
Sarah Goslee
sarah.goslee at gmail.com
Tue May 22 21:26:23 CEST 2012
After fixing the error in your plot statement, this works for me:
plot(pair$MC~pair$Day, pch=c(19,24)[as.factor(pair$Cookie)],
xaxt="n",
main='Paired t Test',
xlab='Days in Field',
ylab='Moisture Content (Percent)', xlim=c(0,45))
axis(1, c(0, 15, 30, 45))
I also added xlim, but that's not necessary.
Sarah
On Tue, May 22, 2012 at 2:31 PM, jhartsho <jhartsho at uark.edu> wrote:
> Bolt Day Cookie MC
> 1 MCA01 0 Bottom 60.28
> 2 MCB01 0 Bottom 83.63
> 3 MCC01 0 Bottom 48.34
> 4 MCB02 0 Bottom 84.52
> 5 MCA05 0 Bottom 74.92
> 6 MCA01 0 Top 65.35
> 7 MCB01 0 Top 88.68
> 8 MCC01 0 Top 29.19
> 9 MCB02 0 Top 82.63
> 10 MCA05 0 Top 77.61
> MC151 15 Bottom 63.92
> 12 MC152 15 Bottom 68.24
> 13 MC153 15 Bottom 63.42
> 14 MC154 15 Bottom 43.15
> 15 MC155 15 Bottom 52.04
> 16 MC151 15 Top 53.39
> 17 MC152 15 Top 55.45
> 18 MC153 15 Top 56.24
> 19 MC154 15 Top 53.52
> 20 MC155 15 Top 42.83
>
> This is a small subset of my data.
>
> plot(pair$MC~pair$Day, pch=c(19,24)[as.factor(Cookie)],
> xaxt="n",
> main='Paired t Test',
> xlab='Days in Field',
> ylab='Moisture Content (Percent)')
>
> Gives me the plot I need minus the x axis. Adding
> axis(1, at=0,15,30,45) or using a sequence of axis(1, at=seq(0,45,15))
> gives me either x and y are different lengths or plot.new has not been
> called yet.
>
> Everything else is perfect.
>
--
Sarah Goslee
http://www.functionaldiversity.org
More information about the R-help
mailing list