Dear Jim, Thank you very much indeed for your quick reply and kind help. The code you provided works perfectly, which is exactly what I want.
Kind regards, Wei On 27 May 2014 14:11, Jim Lemon <j...@bitwrit.com.au> wrote: > On Tue, 27 May 2014 11:36:21 AM Wei Qin wrote: > > ... > > #Then my questions is how to make a broken y axis in grouped > barplot > > figures? > > > > # In another words, how to combine the function of barplot and > gap.barplot? > > > Hi Wei, > The gap.barplot function doesn't do grouped bars (yet). You can probably > get what you want with this: > > newdata<-data > newdata[newdata>200]<-newdata[newdata>200]-140 > barpos<-barplot(newdata,names.arg=colnames(newdata), > ylim=c(0,250),beside=TRUE,col=c("darkblue","red"),axes=FALSE) > axis(2,at=c(0,50,100,150,200,235), > labels=c(0,50,100,150,200,375)) > box() > axis.break(2,210,style="gap") > > Jim > > [[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.