Aesthetics is one of the most important aspect of a chart, hence we should try to use the best possible aesthetic properties in a plot. In a bar chart, we can represent the center of bars in many ways and one such way is using dots at the center of the top edge of the bars. We can use geom_point function by defining colour argument to put points at the center of top edge of the bars in a bar chart created by using ggplot2.
Consider the below data frame:
> freq<-c(212,220,218) > df<-data.frame(x,freq) > df
x freq 1 Mango 212 2 Guava 220 3 Pomegranate 218
Loading ggplot2 package and creating bar chart for x:
> library(ggplot2) > ggplot(df,aes(x,freq))+geom_bar(stat="identity")
Creating bar chart with dots drawn at the center of top edge of the bars: