Thank you Jim, Is it possible to format the label box? The labels(numbers) are surrounded by a big square and wanted to remove it. I just want display only the number. I searched up the documentation for "barlabels" and there is no such example
barlabels(xpos,ypos,labels=NULL,cex=1,prop=0.5,miny=0,offset=0,...) Thank you. On Thu, Apr 2, 2020 at 9:38 PM Jim Lemon <drjimle...@gmail.com> wrote: > > Hi Val, > > library(plotrix) > barpos<-barplot(dat$count, names.arg=c("A", "B", "C","D"), > col="blue", > ylim = c(0,30), > ylab = "Count", > xlab = "Grade") > barlabels(barpos,dat$count,prop=1) > > Jim > > On Fri, Apr 3, 2020 at 1:31 PM Val <valkr...@gmail.com> wrote: > > > > Hi all, > > > > I have a sample of data set, > > > > dat <- read.table(header=TRUE, text='Lab count > > A 24 > > B 19 > > C 30 > > D 18') > > > > barplot(dat$count, names.arg=c("A", "B", "C","D"), > > col="blue", > > ylim = c(0,30), > > ylab = "Count", > > xlab = "Grade") > > > > I want add the number of counts at the top of each bar plot. How can I do > > that? > > Thank you in advance > > > > ______________________________________________ > > R-help@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. ______________________________________________ R-help@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.