0

I wrote this R code:

data <-read.table('data.txt',header=T)
ggplot(data, aes(x=Group, y=Baseline,fill=Group) + geom_boxplot()  +  xlab("Group") + ylab("Height") + scale_y_continuous(limit = c(0, 4.0))
names <- c("name1\ntest1", "name1\ntest2", "name1\ntest3","name1\ntest4","name1\ntest5","name1\ntest6")
g2 + scale_x_discrete(labels= names) + scale_fill_manual(values=c('black','blue','red','green','yellow','brown'))

The output is a boxplot that is correct, but I want the lines leading from the boxplot to the outliers to to look like this and not like this. The two main differences between the boxplots: (1) that I want a small horizontal dash where the vertical line to outlier ends and (2) I would like the vertical line to be dashed.

If anyone could demonstrate I would appreciate it. As a side note, in my actual plot, the y axis 0 does not start on the x axis (like this), but rather the y axis starts after a little gap. If someone also knew how to get the y axis to start at 0, at the same point that the x axis 0 starts that would be great.

Slowat_Kela
  • 1,377
  • 2
  • 22
  • 60
  • Can you please provide a minimal reproducible example of your data so we know what it looks like and can provide code accordingly. – MHammer Jul 03 '18 at 16:57
  • 2
    Possible duplicate of [Put whisker ends on boxplot](https://stackoverflow.com/questions/12993545/put-whisker-ends-on-boxplot) for #1 – Parfait Jul 03 '18 at 17:06
  • Possible duplicate of [Default linetypes in ggplot2?](https://stackoverflow.com/questions/21739299/default-linetypes-in-ggplot2) for #2 – Parfait Jul 03 '18 at 17:12

0 Answers0