I see that you have used
add = TRUE
in the boxplot call. Add only makes sense if there is already a plot to
which to add the boxplot. But your boxplot is first, so there isn't
anything to add it to.
Try doing the beeswarm plot first?
Will the two plots will have the same y axis ranges?
Minor notes:
you don't need both as.is and stringsAsFactors in read.csv
read.csv by definition uses sep=','; you do not need to specify it.
If you want better help do the following:
supply example data (use the "dput" function)
saying it doesn't work is not enough -- describe how it did not work,
and include error messages, if any
read the Posting Guide (link at the bottom of every email on R-help)
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 9/24/15, 12:27 AM, "R-help on behalf of Julia89"
<r-help-bounces at r-project.org on behalf of Julias_89 at gmx.net> wrote:
>Hi everybody,
>I'm new and i need help very fast.
>I will make a transparent boxplot overlap a beeswarm.
>I don't want to use ggplot2, i will use ggplot.
>Here is my own script but it doesn't worked.
>Maybe you can help me.
>Thanks in advance
>Julia
>
>require(beeswarm)#rohdaten boxplots
>
>rm(list=ls())
>setwd("C:/Dokumente und Einstellungen/jbellsta/Desktop/Paper")
>
>#read data
>data
>read.csv(file="HypocotylCellLength.csv",stringsAsFactors=FALSE,header=TRUE
>,
>as.is=TRUE, sep=",")
>str(data)
>attach(data)
>
>
>#schreibe gr????ten wert in Variable L.max
>L.max <- max(LengthMM)
>
>boxplot(LengthMM ~ Label,
>boxwex=.3,
>outline=F,
>add=T,
>ylim=c(0, L.max))
>
>beeswarm(LengthMM ~ Label, # Datenpunkte LengthMM~Label
>pch = 20,
>cex= .6,
>spacing = .3,
>method =c("swarm"),
>col= c('grey')
>)
>
>
>
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/boxplot-overlap-beeswarm-tp4712727.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.