Re: [R] plot mixed variables

2011-12-05 Thread Sarah Goslee
plot(xx1, yy, ylim = c(-13.5, 4), col="blue", xaxt="n") axis(1, at=c(1, 2), labels=c("C", "D")) Defining your own axes with axis() offers a great deal of flexibility. And thank you for providing a small reproducible example. Sarah On Mon, Dec 5, 2011 at 5:43 PM, Juliet Ndukum wrote: > > > >  M

[R] plot mixed variables

2011-12-05 Thread Juliet Ndukum
My data consists of a numeric (yy) variable and a categorical (xx) variable, as shown below. xx = c(rep("C", 5), rep("D",5)) yy = rnorm(10, 0, 4) xx1 = as.integer(as.factor(xx))   plot(xx1, yy, ylim = c(-13.5, 4), col="blue")   I wish to generate a scatter plot of the data su