tags:

views:

77

answers:

1

So far I have this:

hist <- ggplot(Mydf, aes(x=Mydf$Avg.CPC))
breaks <- c(min(Mydf$Avg.CPC), median(Mydf$Avg.CPC), max(Mydf$Avg.CPC))
h <- hist + geom_bar(binwidth = 0.025, colour = "black", breaks = breaks)
print(h)

I get an error. It doesn't like having different widths. I would also like to have the Q1 and Q3 quartiles as breaks while I am at it. Is that not possible? I think it is called a violin plot. Thanks

+1  A: 

is this what you are looking for?

df<-data.frame(a=rnorm(100))
hist <- ggplot(df, aes(x=a))
#breaks <- c(min(df$a), median(df$a), max(df$a))
breaks <-  quantile(df$a,0:4*0.25)
h <- hist + stat_bin(colour="black",breaks = breaks,position="dodge")
print(h)
kohske