By default, the space between bars is equal irrespective of the number of bars in the plot. If we want to have different space between bars then space arguments need to be used inside the barplot function but the first value does not make an impact because the first space is fixed between Y-axis and the first bar. For example, if we have a vector x that contains three values then the barplot with different space between bars can be created by using the below command −
barplot(x,space=c(0.5,0.1,0.5))
x<-rpois(4,5) x
[1] 3 8 4 4
barplot(x)
barplot(x,space=c(0.01,0.1,0.5,0.1))
barplot(x,space=c(0.1,0.2,0.2,0.5))