I solved the problem by looking at the URL marked as a duplicate. Thanks to MrFlick!
I had following to plot the bars:
[...]
data <- structure(list(vdb, vdc, vdd, vde),
.Names = c("4K", "16K", "32K", "64K"),
class = "data.frame", row.names = c(NA, 4L))
colours <- c("green", "orange", "blue", "red")
barObj <- barplot(as.matrix(data), main=title, ylab = "IOPS (log scale)",
cex.lab = 1.2, cex.main = 1.4,
beside=TRUE, col=colours, log="y")
legend("topright", c("B", "C", "D", "E"), cex=1.3, bty="n", fill=colours)
Adding following two lines put numbers on top of bars.
[...]
data <- structure(list(vdb, vdc, vdd, vde),
.Names = c("4K", "16K", "32K", "64K"),
class = "data.frame", row.names = c(NA, 4L))
values = c(vdb, vdc, vdd, vde) # added line
colours <- c("green", "orange", "blue", "red")
barObj <- barplot(as.matrix(data), main=title, ylab = "IOPS (log scale)",
cex.lab = 1.2, cex.main = 1.4,
beside=TRUE, col=colours, log="y")
text(x=barObj, y=values, label=values, cex=0.9, pos=3, col="black", xpd=TRUE) # added line
legend("topright", c("B", "C", "D", "E"), cex=1.3, bty="n", fill=colours)