Greetings I have a very simple question that I have not been able to solve by reading the manual. When I produce a stripchart with two straight columns of dots representing individual observations, one representing one group of subjects and the other representing another, the columns wind up at the far left and far right sides of the plot, and I'd like them to be closer together, about as far apart as they'd be if I used the boxplot function. I would also like to add a short horizontal line where the mean is for each of the columns, so that my readers can see the results of my significant t test graphically. Any assistance in moving my columns together and adding just a short horizontal line for the mean of each would be great. Sincerely, Dr. Leslie J. Seltzer University of Wisconsin-Madison 382 Waisman Center 1500 Highland Ave Madison, WI 53705 PHONE: (608) 886 6067 www.waisman.wisc.edu/childemotion
I agree; the stripchart defaults place things too close to the edges for 'neat' layout. Use at= coupled with ylim (or xlim, if vertical) to place the rows explicitly and leave room at the margins. Extending the last example in ?stripchart: stripchart(decrease ~ treatment, main = "stripchart(OrchardSprays)", vertical = TRUE, log = "y", data = OrchardSprays, at=1:8, xlim=c(0.5,8.5) ) #Get the group means OS.means<-with(OrchardSprays, tapply(decrease, treatment, mean) ) #Plot horizontal line segments at each mean segments(1:8-0.2, OS.means, 1:8+0.2, OS.means, lwd=2)>>> Leslie J Seltzer <lseltzer at wisc.edu> 20/07/2009 22:22:05 >>>Greetings I have a very simple question that I have not been able to solve by reading the manual. When I produce a stripchart with two straight columns of dots representing individual observations, one representing one group of subjects and the other representing another, the columns wind up at the far left and far right sides of the plot, and I'd like them to be closer together, about as far apart as they'd be if I used the boxplot function. I would also like to add a short horizontal line where the mean is for each of the columns, so that my readers can see the results of my significant t test graphically. Any assistance in moving my columns together and adding just a short horizontal line for the mean of each would be great. Sincerely, Dr. Leslie J. Seltzer University of Wisconsin-Madison 382 Waisman Center 1500 Highland Ave Madison, WI 53705 PHONE: (608) 886 6067 www.waisman.wisc.edu/childemotion ______________________________________________ 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. ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}
Leslie J Seltzer wrote:> > Greetings > > I have a very simple question that I have not been able to solve by reading the manual. When I produce a stripchart with two straight columns of dots representing individual observations, one representing one group of subjects and the other representing another, the columns wind up at the far left and far right sides of the plot, and I'd like them to be closer together, about as far apart as they'd be if I used the boxplot function. I would also like to add a short horizontal line where the mean is for each of the columns, so that my readers can see the results of my significant t test graphically. > > Any assistance in moving my columns together and adding just a short horizontal line for the mean of each would be great.See the arguments "at", "offset" and the possible arguments "xlim" or "ylim". I'd suggest you control the height/width by xlim/ylim and position the columns/rows by specifying specific "at" values. You can use lines() to add lines into certain positions of your plot. Uwe Ligges> Sincerely, > > Dr. Leslie J. Seltzer > University of Wisconsin-Madison > 382 Waisman Center > 1500 Highland Ave > Madison, WI 53705 > PHONE: (608) 886 6067 > www.waisman.wisc.edu/childemotion > > ______________________________________________ > 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.