The plot below (which was created w/ the code just above it) shows the type of cars produced by the major car makers.
I mapped bar height (actually bar-segment height) to automobile class; and I mapped bar-segment color to automobile manufacturer. Hence, each of the seven x-axis labels corresponds to one level in the factor 'class'; likewise, each color of the bar segments corresponds to one level in the factor 'manufacturer' (both 'manufacturer' and 'class' are variables/columns w/in the 'mpg' dataframe. Finally, the y axis shows the number of cars in each class (bar height) by manufacturer (segment color).
library(ggplot2)
data(mpg) # data set provided w/ ggplot2
px = ggplot(mpg, aes(x=class, fill=manufacturer)) + geom_bar()
print(px)