[R] how to construct stripchart with coincident points centered

Berta ibanez at bioef.org
Mon Sep 11 09:39:26 CEST 2006


Thanks Rob for the clue, it is nearly  but not exactly what I am looking 
for.
If we plot the first figure as I want (but not centered) and the second 
figure as you suggest:

 win.graph(); par(mfrow=c(2,1));  y <-rbinom(100, 3, 0.5)
 stripchart(y, method="stack", pch="o", vertical=TRUE); abline(v=1)
 stripchart(y, method="jitter", pch="o", vertical=TRUE,jitter=.5); 
abline(v=1)

we obtain "more or less" a symmetric plot in the second figure but points 
within the same value are not equally distanced as I wish (sorry, I did not 
tell this in the previous message). Is there a method in which I can obtain 
the first figure but with coincident points centered and equally distanced?

Thanks again,

Berta.

> You may be looking for:
> stripchart(y, method="jitter", pch="o", vertical=TRUE,jitter=.5)
>
> Rob

> ----- Original Message ----- 

>> Hi R-users,
>> I am using stripchart with coincident points,
>>
>> y <-rbinom(100, 3, 0.5)
>> stripchart(y, method="stack", pch="o", vertical=TRUE)
>>
>> But the result is not centered in the sense that if a value (say value 0)
> is
>> repeated 7 times, the first point is ploted in the middle and the rest at
>> its right side, in stead of ploting 3 at its right and 3 at its left. 
>> Can
>> anybody help?
>>
>> Thanks,
>> Berta.



More information about the R-help mailing list