Quantcast

overlap dot plots with box plots

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
ADM
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

overlap dot plots with box plots

ADM
Hi,

I am new in R and would like to dot plot my real data points from different categories and put box plot overlapping. To give a feeling of the distribution of my data and the real values.
I managed to that in excel but it takes a lot of time and it makes the program crash quite often!


I managed to get a box plot and a dot plot of my three categories that look like

but cannot plot them one on top of the other. Any suggestion would be really apreciated!!

I would also like to color only the dots and leave the box plot 'transparent' as in the excel version, tips on that are also welcome!

Thanks a lot in advance

ADM
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: overlap dot plots with box plots

Peter Ehlers
Looks like you're just missing the 'add=TRUE' argument; see below.

On 2010-05-07 11:07, ADM wrote:

>
> Hi,
>
> I am new in R and would like to dot plot my real data points from different
> categories and put box plot overlapping. To give a feeling of the
> distribution of my data and the real values.
> I managed to that in excel but it takes a lot of time and it makes the
> program crash quite often!
> http://n4.nabble.com/file/n2134530/Excelversion.jpg
>
> I managed to get a box plot and a dot plot of my three categories that look
> like  http://n4.nabble.com/file/n2134530/Rplot_boxplot.jpg
> http://n4.nabble.com/file/n2134530/Rplot_dotplot.jpg
>
> but cannot plot them one on top of the other. Any suggestion would be really
> apreciated!!
>
> I would also like to color only the dots and leave the box plot
> 'transparent' as in the excel version, tips on that are also welcome!
>
> Thanks a lot in advance
>
> ADM

  Maybe something like this:

boxplot(count ~ spray, data = InsectSprays, outpch = NA)
stripchart(count ~ spray, data = InsectSprays,
            vertical = TRUE, method = "jitter",
            pch = 21, col = "maroon", bg = "bisque",
            add = TRUE)

(Setting 'outpch = NA' avoids plotting outliers.)

  -Peter Ehlers

______________________________________________
[hidden email] 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.
ADM
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: overlap dot plots with box plots

ADM
In reply to this post by ADM
Thanks for the answers, I finally managed!
Still need to learn a lot but with such fast help will be easy :)



Thanks again

A
Loading...