## The bar plot

Start with a dataframe with the values already sorted, then place each into a vector.

core<-tdf$'core' mid<-tdf$'middle' per<-tdf$'periphery'

The three back into a dataframe

bpDataFrame<-data.frame(per,mid,core)

## The Bar Plot

Place the bartop into a variable to use later

theBarPlot<-barplot(as.matrix(t(bpDataFrame)))

The graph should look something like this

## A Ragged Line

Take the Gini coef column from the original dataframe…

theGiniCoef<-tdf$'gini'

Put everything together now and plot the bar graph and the line …

lines(theBarPlot,theGiniCoef,col="Grey",lwd=2)

The graph now looks like this

## The Smooth Line

Now add a smooth line that will show an over-all trend for the Gini coef using `loess()`

x<-1:length(theGiniCoef) lo<-loess(theGiniCoef~x)

Now plot the thing: white line, thikness = 2.

lines(theBarPlot,predict(lo),col='white',lwd=2)

Now, it looks likes this!

DONE!