@Amit : just check the code where you have created count bcoz tat where you calculate frequency of the disp column elements. and you plot those frequency. Remember Bar plot is used to plot categorical data along with there frequencies.Hi Priyanka,
barplot(count,main = "Bar Plot",xlab = "disp", ylab = "frequency",
names = c("High", "medium","low"), legend = row.names(count),
col = c("red","blue","green"))
In the above bar plot we are taking displacement in x axis. Does the bar plot takes average displacement for gears 3, 4 & 5 respectively in the X axis.