Re: [R] Plot and Boxplot in the same graph
Look at the symbols function or the subplot function in the TeachingDemos package (or my.symbols in TeachingDemos). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of johnhj Sent: Sunday, March 22, 2009 5:18 AM To: r-help@r-project.org Subject: Re: [R] Plot and Boxplot in the same graph I tried to do it with: y - rnorm(100) x - gl(2,50) boxplot(x,y) points(x,y) But the problem is, that the the y coordinates are shown for the boxplot and not for points(x,y) Is it possible to show the graph with the (x,y) coordinates with the points() function and the boxplots only for the x coordinates. A better solution could be to have a seperated y axis on the left side for the boxplots(). Is it possible to do it in this was ? Paul Johnson-11 wrote: On Fri, Mar 20, 2009 at 10:02 PM, johnhj jhar...@web.de wrote: Hii, Is it possible, to use the plot() funktion and the boxplot() funktion together ? I will plot a simple graph and additionally to the graph on certain places boxplots. I have imagined to plot the graph a little bit transparency and show in the same graph on certain places boxplots Is it possible to do it in this way ? greetings, johnh -- Run the boxplot first, then use points() or other subsidiary plot functions to add the points in the figure. y - rnorm(100) x - gl(2,50) boxplot(x,y) points(x,y) -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas __ R-help@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-and-Boxplot- in-the-same-graph-tp22632355p22645076.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. __ R-help@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.
Re: [R] Plot and Boxplot in the same graph
I tried to do it with: y - rnorm(100) x - gl(2,50) boxplot(x,y) points(x,y) But the problem is, that the the y coordinates are shown for the boxplot and not for points(x,y) Is it possible to show the graph with the (x,y) coordinates with the points() function and the boxplots only for the x coordinates. A better solution could be to have a seperated y axis on the left side for the boxplots(). Is it possible to do it in this was ? Paul Johnson-11 wrote: On Fri, Mar 20, 2009 at 10:02 PM, johnhj jhar...@web.de wrote: Hii, Is it possible, to use the plot() funktion and the boxplot() funktion together ? I will plot a simple graph and additionally to the graph on certain places boxplots. I have imagined to plot the graph a little bit transparency and show in the same graph on certain places boxplots Is it possible to do it in this way ? greetings, johnh -- Run the boxplot first, then use points() or other subsidiary plot functions to add the points in the figure. y - rnorm(100) x - gl(2,50) boxplot(x,y) points(x,y) -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas __ R-help@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-and-Boxplot-in-the-same-graph-tp22632355p22645076.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Plot and Boxplot in the same graph
On Fri, Mar 20, 2009 at 10:02 PM, johnhj jhar...@web.de wrote: Hii, Is it possible, to use the plot() funktion and the boxplot() funktion together ? I will plot a simple graph and additionally to the graph on certain places boxplots. I have imagined to plot the graph a little bit transparency and show in the same graph on certain places boxplots Is it possible to do it in this way ? greetings, johnh -- Run the boxplot first, then use points() or other subsidiary plot functions to add the points in the figure. y - rnorm(100) x - gl(2,50) boxplot(x,y) points(x,y) -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas __ R-help@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.
Re: [R] Plot and Boxplot in the same graph
Hi there. Try the add parameter in boxplot: add logical, if true *add* boxplot to current plot. On Sat, Mar 21, 2009 at 5:02 AM, johnhj jhar...@web.de wrote: Hii, Is it possible, to use the plot() funktion and the boxplot() funktion together ? I will plot a simple graph and additionally to the graph on certain places boxplots. I have imagined to plot the graph a little bit transparency and show in the same graph on certain places boxplots Is it possible to do it in this way ? greetings, johnh -- View this message in context: http://www.nabble.com/Plot-and-Boxplot-in-the-same-graph-tp22632355p22632355.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. -- -- My contact information: Tal Galili Phone number: 972-50-3373767 FaceBook: Tal Galili My Blogs: http://www.r-statistics.com/ http://www.talgalili.com http://www.biostatistics.co.il [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Plot and Boxplot in the same graph
On 2009-March-20 , at 23:02 , johnhj wrote: Is it possible, to use the plot() funktion and the boxplot() funktion together ? I will plot a simple graph and additionally to the graph on certain places boxplots. I have imagined to plot the graph a little bit transparency and show in the same graph on certain places boxplots If you don't mind letting got the base graphics in R, you can look into http://had.co.nz/ggplot2/ The representations you are interested in are geom_jitter and geom_boxplot and in the help page of geom_jitter there is an example of specifically what you just asked: http://had.co.nz/ggplot2/geom_jitter.html look at the end. As for transparency, you can use geom_boxplot(fill=alpha(white,0.5)) for example. JiHO --- http://jo.irisson.free.fr/ __ R-help@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.