Search code examples
rchartslabelhistogram

Bar label is getting cut from the plot and mai/omi parameters aren't fixing the issue


I put labels on my bars, but the first one is falling out of the chart. I tried applying mai= and omi= parameters to no avail. Below is the code I'm using to create the chart:

hist(airquality$Ozone, col = "lightblue4", main="", , labels = TRUE,yaxt='n',ylab = "", xlab="Ozone (ppb)")
title("Ozone quantity in New York in 1978 (count)")

enter image description here


Solution

  • You can change the y axis limits with the argument ylim

    hist(airquality$Ozone,
         col = "lightblue4", main="",ylim = c(0,40) ,
         labels = TRUE,yaxt='n',ylab = "", xlab="Ozone (ppb)")