data(gdp)
attach(gdp)
par(mfrow=c(1,2))
hist(gdp2010,xlim=range(gdp2010),ylim=c(0,0.00015),prob=TRUE,breaks=55,
col="light gray",border="dark gray",xlab="GDP per capita 2010",main="Histogram")
plot(ecdf(gdp2010),xlim=range(gdp2010),ylim=c(0,1),verticals=TRUE,do.points=FALSE,
col="dark gray",xlab="GDP per capita 2010",main="ecdf")
Run the code above in your browser using DataLab