The default styling of histograms does not look great and might not be suitable for publications. In this recipe, we will learn how to improve the look by setting bar colors and borders, and adjusting the axes.
Once again we will use the airpollution.csv
example. So, let's make sure it is loaded by running the following command at the R prompt:
air<-read.csv("airpollution.csv")
Let's visualize the probability distribution of respirable particle concentrations with black bars and white borders:
hist(air$Respirable.Particles, prob=TRUE,col="black",border="white", xlab="Respirable Particle Concentrations", main="Distribution of Respirable Particle Concentrations")