0

I’ve a variable named as Hours_taken, and made a frequency distribution, which is Ramit_data, portrayed below.

Ramit_data

x     freq
1.1-2    1
2.1-3    4
3.1-4    6
4.1-5    4
5.1-6    2
6.1-7    3    

I’m now making a Barplot by the Ramit_data which is looking like below

barplot(Ramit_data$freq,ylim = c(0,7),col = rainbow(6),main="Hours taken by stores",xlab = "Count")

enter image description here

However I want this data to be showcased along with the frequency as a data labels above/within bars.

Note- Data labels design is not required as I’ve just shown what I wanted, hence any help is appreciated.

enter image description here

h3rm4n
  • 4,126
  • 15
  • 21
user817995
  • 17
  • 1
  • 4
  • How about this `plt <- barplot(...); text(x = plt, y = Ramit_data$freq, label = Ramit_data$x, pos = 3, cex = 0.8, col = "black")`? – Prem Feb 25 '18 at 10:18
  • 1
    plt <- barplot(Ramit_data$freq,ylim = c(0,8),col=rainbow(6)); text(x = plt, y = Ramit_data$freq, labels = Ramit_data$x, pos = 3, cex = 0.8, col = rainbow(6)) – user817995 Feb 25 '18 at 11:03
  • Thanks mate, its much appreciated – user817995 Feb 25 '18 at 11:04

0 Answers0